News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Post TeamMessaging on behalf of others (Impersonate messages)
Tags: webhooks
Oct 18, 2021 at 6:36am   •   1 replies  •  0 likes
Rajeev Garg

Hi,

We are using User token \ Bot token to post the message using chatId.
When Bot token is used it is posted as the Bot and with User access token the message is shown that as the User posted the message.

For a particular use case we want to show the message is posted from an external user and not from Bot \ User
Is that possible to change the display name and avatar when we post the message ?


We created incoming webhooks using REST API to post the message . But it shows incoming webhook icon and name as below
1634563801665.png

Can we customize the icons and avatar ?

Thanks,

Raja



1 Answer
answered on Oct 18, 2021 at 7:43pm  

Make the body of your post like this

var body = {
    icon: "http://www.somedomain.com/icons/avatar.png", // publicly accessible
    activity: "Display name ABC",
    title: "Some title",
    body: "Your message"
  }

 0
on Oct 19, 2021 at 12:36am   •  0 likes

Thanks @Phong Vu ,
We can able to change the displayName but icon is still showing from incoming webhook.
We created the incoming webhook using REST API with Bot Token.
1634628346360.png

Payload for the incoming webhook :

{

"icon":"https://i.stack.imgur.com/l60Hf.png",

"activity": "Jack",

"body": "Your message",

"text": "Welcome"

}

Note: It is not working for posting message through REST API.

Is there anything we need to add to change the image\icon ?

on Oct 19, 2021 at 7:19am   •  0 likes

You mentioned using incoming webhook, why did you use the REST post API? No, using the API is not possible to fake the avatar and name.

on Oct 19, 2021 at 10:05am   •  0 likes

Hi @Phong Vu , We can create incoming webhooks in two ways,

Approach 1 : Through incoming webhooks app (Manual Way)
1.1 User has to manually add the app to the desired channel and share the incoming webhook.
1.2 For the webhook created in this way, the above payload is working good.
1634662162469.png

Approach 2. Through REST API (Automated way)
2.1 Bot app calls the following end point and gets the incoming webhook url in the response
POST https://platform.ringcentral.com/restapi/v1.0/glip/groups/<group-id>/webhooks

2.2 For the webhook created in this way, with the above payload the icon is not changing
1634662960060.png


. We are more interested on Approach 2 as it automates the flow.
Could you please help us to change the icon for the Approach 2




A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us