Skip to main content
Question

Post TeamMessaging on behalf of others (Impersonate messages)

  • October 18, 2021
  • 2 replies
  • 267 views

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



PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • October 19, 2021

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

  • New Participant
  • October 19, 2021

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings