USE CASES Add an OptOut This document will go over how to add an OptOut using our API.
POST
addressbook/optout
Create an Opt-Out in our system.
Curl Python
Copy curl -X POST \
"https://api.mobivatebulksms.com/addressbook/optout" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [API Key]' \
-d '{ "mobile": "440011122233" }'
Copy import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer [API Key]',
}
json_data = {
'mobile': '440011122233',
}
response = requests.post('https://api.mobivatebulksms.com/addressbook/optout', headers=headers, json=json_data)
# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{ "mobile": "440011122233" }'
#response = requests.post('https://api.mobivatebulksms.com/addressbook/optout', headers=headers, data=data)
Headers
Body
Name
Type
Required?
Description
Mobile number to add to Optout list.
Response
200 400 401
Copy {
"mobile":"440011122233",
"note":"API",
"created":1690783496000
}
Copy {
"code":400,
"message":"Invalid mobile number"
}
Copy {
"code":401,
"message":"Unauthorized"
}
We use conventional HTTP response codes to indicate the success or failure of an API request. In general:
2xx indicate success
4xx indicate an error that failed given the information provided (e.g., a required parameter was omitted)
5xx errors indicate an error with ours servers (these are rare).
To see a full list of our Response codes , please click here .
Last updated 11 months ago