The Stop Sending SMS to Contact command allows you to unsubscribe an existing SMS contact from an SMS Sender Code. The command is used to remove Contacts who no longer wish to receive SMS messages.
POST /sms/stopSubscriberSend
https://[siteurl]/rest/sms/stopSubscriberSend/[phone]/[senderCode]
Request Body Parameters
The Stop Sending SMS to Contact command requires the URI call with the Contact Phone and SMS Sender Code.
Request Body Example
Using Stop Sending SMS to Contact with all arguments, line breaks in JSON for readability:
curl --request POST \
--url 'https://mail.mydomain.com/rest/sms/stopSubcriberSend/2065959696/2065551212' \
--header 'authorization: Basic bXlBY2NvdW50Onh5enB3ZDEyMw==' \
--header 'content-type: application/json' \
--header 'accept: application/vnd.whatcounts-v1+json' \
--include
Response Body
The response returns JSON or an HTTP status code. Based on the first example above, the response returns:
HTTP/1.1 200 OK
Server: serverName
Content-Type: application/json
Content-Length: 456
Date: Fri, 16 Mar 2018 09:10:50 GMT
{
"id": 15
"smsSubscriberId": 424
"smsSenderId": 3
"realmId": 10
"campaignId": 0
"phone": "12065959696"
"createdDate": "Mar 16, 2018 09:10:50 AM"
"updatedDate": "Mar 16, 2018 09:10:50 AM"
}
Error Response
Error Response Codes include both Client Errors (4xx) and Server Errors (5xx). Descriptions of each can be found in Response Codes. An error will occur if Message Name or Text is blank, or a Message with the same Name already exists.
For example, if a Phone number for the Sender Code does not exist, the error would appear as:
{
"error": "An error occurred processing STOP sends for phone [12065959696] realmId [10]"
"status": "Internal Server Error"
"statusCode": 500
}
Feature added in v12.16.0