Skip to main content

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



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"
}

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 imageicon ?


Reply