USE CASES List OptOuts This document will go over how to list all of your OptOut requests.
GET
/addressbook/optout
List all of your OptOuts between two set dates.
Curl Python
Copy curl -X GET \
"https://api.mobivatebulksms.com/addressbook/optout?startDate=2023-01-01&endDate=2023-01-02" \
-H 'Authorization: Bearer [API Key]'
Copy import requests
headers = {
'Authorization' : 'Bearer [API Key]' ,
}
params = {
'startDate' : '2023-01-01' ,
'endDate' : '2023-01-02' ,
}
response = requests . get ( 'https://api.mobivatebulksms.com/addressbook/optout' , params = params, headers = headers)
Retrieve 100 Optouts between 2023-01-01 00:00:00 (UTC) and 2023-01-02 00:00:00 (UTC).
Curl Python
Copy curl -X GET \
"https://api.mobivatebulksms.com/addressbook/optout?startDate=2023-01-01&endDate=2023-01-02&pageSize=100" \
-H 'Authorization: Bearer [API Key]'
Copy import requests
headers = {
'Authorization' : 'Bearer [API Key]' ,
}
params = {
'startDate' : '2023-01-01' ,
'endDate' : '2023-01-02' ,
'pageSize' : '100' ,
}
response = requests . get ( 'https://api.mobivatebulksms.com/addressbook/optout' , params = params, headers = headers)
Retrieve Opt-Outs between 2023-01-01 12:00:00 (AEST) and 2023-01-02 12:00:00 (AEST).
Curl Python
Copy curl -X GET \
"https://api.mobivatebulksms.com/addressbook/optout?startDate=2023-01-01T12:00:00%2B1200&endDate=2023-01-02T12:00:00%2B1200" \
-H 'Authorization: Bearer [API Key]'
Copy import requests
headers = {
'Authorization' : 'Bearer [API Key]' ,
}
response = requests . get (
'https://api.mobivatebulksms.com/addressbook/optout?startDate=2023-01-01T12:00:00%2B1200&endDate=2023-01-02T12:00:00%2B1200' ,
headers = headers,
)
Headers
Body
Name
Type
Required?
Description
Start Date Format(s):
Examples :
2023-01-01T00:09:00+0900
.
End Date.
Examples : See startDate.
Number of message records to return.
Default : 10
Max : 1000.
Response
200 400 401
Copy [
{
"id" : 1354505990 ,
"mobile" : "4400111222" ,
"note" : "MO" ,
"created" : 1672704203000
}
]
Copy {
"code" : 400 ,
"message" : "startDate: Invalid format: \"2023-01-011\" is malformed at \"1\""
}
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 9 months ago