Agentless SMS Notifications
Introduction
This tutorial will explain how to use Genesys Cloud public api to send agentless outbound sms notifications and invoke them from another system.
Create or use an existing OAuth client.
You will need an OAuth client with the Conversation:Message:Create
permission assigned to the OAuth client. See Create an OAuth Client for more info.
Generate an OAuth client token
In order to call the endpoint to send agentless outbound sms notifications you will need to use your OAuth client to generate a token. See Grant - Client Credentials for more info.
Use the OAuth client token to call the agentless outbound sms endpoint
Using the public api you will need to call the POST /api/v2/conversations/messages/agentless to send the message. Use the previously generated Oauth client token as "Authoization: Bearer {OAuthClientToken}"" header in the request. The POST body should look like this:
{
"fromAddress": "", //An already provisioned sms number provisioned in the org
"toAddress": "", //The e164 formatted number you are sending the notification to
"toAddressMessengerType": "sms",
"textBody": "" //The text body of the notification to send
}
The response body will look like the following:
{
"id": "", //Id of the message
"conversationId": "", //The conversation id that was used to send the message
"fromAddress": "", //The from address used from the request body
"toAddress": "", //The to address used from the request body
"messengerType": "", //The messenger type used from the request body
"textBody": "", //The text body used from the request body
"timestamp": "2019-12-12T14:11:08.458Z", //The time the sms notification was sent
"selfUri": "" //self uri for this message Id
}