cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1496
Views
6
Helpful
2
Replies

Include a mention when creating a new message via API

jrolfe
Level 1
Level 1

Is it possible to include a mention when creating a new message in a Webex space via API?  I can retrieve messages with mentions and see how it utilizes the mentionedPeopleId field, and I can get people ID's via v1/people, but the documentation on creating new messages doesn't have anything about including a mention when creating a new message, leaving me to assume it's likely just not possible.

I can't seem to find any markdown that might enable me to do this via markdown formatting either.  And simply including "@(display name)" or "@(email)" in the markdown in the request body doesn't resolve to an individual when the message is posted, it just puts the literal text there.

We have some chat rooms that are quite busy and therefore folks have configured notifications for @mentions only.  It would be very nice when an application that we've integrated to Webex could post a message to one of those channels and mention the individual the message was relevant to.  That way the individual could then get notified on that specific message while ignoring the other noise going on in the channel.

1 Accepted Solution

Janos Benyovszki
Cisco Employee
Cisco Employee

@jrolfe it is actually in the documentation here https://developer.webex.com/docs/basics#formatting-messages . Go to Mentions and you will see some examples. Here is a more concrete snippet with cURL:

curl --location 'https://webexapis.com/v1/messages' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"roomId": "YOUR_ROOM_ID",
"markdown": "<@all>, we have some exciting news! Please watch this space for more information..."
}'

 

View solution in original post

2 Replies 2

jrolfe
Level 1
Level 1

Well so it is, thanks!  I totally missed that in the markup documentation.

Janos Benyovszki
Cisco Employee
Cisco Employee

@jrolfe it is actually in the documentation here https://developer.webex.com/docs/basics#formatting-messages . Go to Mentions and you will see some examples. Here is a more concrete snippet with cURL:

curl --location 'https://webexapis.com/v1/messages' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"roomId": "YOUR_ROOM_ID",
"markdown": "<@all>, we have some exciting news! Please watch this space for more information..."
}'