02-22-2023 12:56 AM
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.
Solved! Go to Solution.
02-22-2023 03:57 AM
@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..."
}'
02-22-2023 09:35 AM
Well so it is, thanks! I totally missed that in the markup documentation.
02-22-2023 03:57 AM
@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..."
}'
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide