Returns the subscription status of the given phone numbers. You can either provide a list of phone numbers or a CSV file containing the phone numbers.
URL
POST https://api.wknd.ai/text/subscription/status
Request Headers
The following are used for authentication/authorization checks.
X-Client-ID: A 32-byte hashed string provided by Wunderkind.
X-Client-Secret: A 64-byte hashed string provided by Wunderkind.
Body Parameters
Model:
{
"phone_numbers": {
"phone_numbers": [
"+11234567890",
]
},
"csv_file": "cGhvbmVfbnVtYmVycworMTEyMzQ1Njc4OTAKKzE5ODc2NTQzMjEw"
}
phone_numbers - (optional) an array of strings.
- Each phone number must be in E.164 format. e.g. ["+11234567890", "+19876543210"]
- This field can be empty if **csv_file **is specified.
csv_file - (optional) a CSV file containing phone numbers.
- The file must be encoded in base64 before sending
- The CSV file must have a header phone_numbers
- Each phone number must be in E.164 format
- This field can be empty if phone_numbers is specified
Either phone_numbers (maximum 5,000 phone numbers) or csv_file (maximum 50,000 phone numbers) must be specified.
Example CSV file content:
phone_numbers
+11234567890
+19876543210
Responses
Success Response - 200.
Model:
{
"phoneNumberStatuses": [
{
"phoneNumber": "+11234567890",
"subscriptionStatus": false
},
{
"phoneNumber": "+19876543210",
"subscriptionStatus": false
}
],
"invalidPhoneNumbers": [ ]
}
phoneNumberStatuses - an array of objects representing the subscription status of each phone number.
- phoneNumber - a string representing the phone number..
- subscriptionStatus - a boolean representing the subscription status of the phone number
invalidPhoneNumbers - an array of strings representing invalid phone numbers that could not be processed.
Error Responses
Model:
{
"code": 0,
"message": "string",
"details": []
}
- code - error code
- message - error message
- Details - (optional) additional info will be appended here
Error Codes
- 401 - Unauthorized
- 403 - Forbidden
- 429 - Denied (exceed the limits)
- 4XX(others) - Bad Request
- 5XX - Internal Server Error
Examples
Request with phone_number:
curl -X 'POST' \
'https://api.wknd.ai/text/subscription/status' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'X-Client-ID: ********s19bvx18vly70bk5********' \
-H 'X-Client-Secret: ********c2a4b82f10f8a137b1b056c6f3f3909ddc062a6fb6b4826c********' \
-d '{
"phone_numbers": ["+11234567890", "+19876543210"]
}'
Response:
{
"phoneNumberStatuses": [
{
"phoneNumber": "+11234567890",
"subscriptionStatus": false
},
{
"phoneNumber": "+19876543210",
"subscriptionStatus": false
}
],
"invalidPhoneNumbers": []
}
Request with csv_file:
curl -X 'POST' \
'https://api.wknd.ai/text/subscription/status' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'X-Client-ID: ********s19bvx18vly70bk5********' \
-H 'X-Client-Secret: ********c2a4b82f10f8a137b1b056c6f3f3909ddc062a6fb6b4826c********' \
-d '{
"csv_file": "cGhvbmVfbnVtYmVycworMTEyMzQ1Njc4OTAKKzE5ODc2NTQzMjEw"
}'
Response:
{
"phoneNumberStatuses": [
{
"phoneNumber": "+11234567890",
"subscriptionStatus": false
},
{
"phoneNumber": "+19876543210",
"subscriptionStatus": false
}
],
"invalidPhoneNumbers": []
}