Manage Subscribers
For authentication,The Username and Password should be sent as a Basic Auth tokens in the Authorization header of the request. Create account.
API endpoint:
get
https://api.txt.ws/v3/subscriber_get/{phone_number}
Description:
Get subscriber data
Request example
curl --location --request POST 'https://api.txt.ws/v3/subscriber_get/{phone_number}' \
--header 'Authorization: Basic {api_key:secret_key}'
--header 'Content-Type: application/json'
| Parameter | Type | Description |
| phone_number | Required string | Phone Number. |
API endpoint:
post
https://api.txt.ws/v3/subscriber_insert
Description:
Create new subscriber
Request example
curl --location --request POST 'https://api.txt.ws/v3/subscriber_insert' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {api_key:secret_key}' \
--data-raw '{
"number":"151325306",
"campaign_id":"C1N9GUB",
"country":"",
"city":"",
"state":"",
"postalCode":"",
"isocode":"",
"carrier":"",
"carrier_lookup":true,
}'
| Parameter | Type | Description |
| number | Required string | number |
| campaign_id | Required string | campaign_id |
| country | Optional string | country |
| city | Optional string | city |
| state | Optional string | state |
| postalCode | Optional string | postalCode |
| isocode | Optional string | isocode |
| carrier | Optional string | carrier |
| carrier_lookup | Optional string | carrier_lookup |
API endpoint:
post
https://api.txt.ws/v3/subscriber_update/{phone_number}
Description:
Update Subscriber
Request example
curl --location --request POST 'https://api.txt.ws/v3/subscriber_update/{phone_number}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {api_key:secret_key}'
--data-raw '{
"number":"15132530620",
"campaign_id":"C19GUBD",
"country":"",
"city":"",
"state":"",
"postalCode":"",
"isocode":"",
"carrier":"",
"carrier_lookup":true,
}'
| Parameter | Type | Description |
| number | Required string | number |
| campaign_id | Required string | campaign_id |
| country | Optional string | country |
| city | Optional string | city |
| state | Optional string | state |
| postalCode | Optional string | postalCode |
| isocode | Optional string | isocode |
| carrier | Optional string | carrier |
| carrier_lookup | Optional string | carrier_lookup |
API endpoint:
delete
https://api.txt.ws/v3/subscriber_delete/{phone_number}
Description:
Delete Subscriber
Request example
curl --location --request DELETE 'https://api.txt.ws/v3/subscriber_delete/15132530620' \
--header 'Authorization: Basic {api_key:secret_key}' \
--header 'Content-Type: application/json'
| Parameter | Type | Description |
| phone_number | Optional string | Phone Number. |
API endpoint:
get
https://api.txt.ws/v3/subscriber_import
Description:
Import subscribers
Request example
curl --location --request POST 'https://api.txt.ws/v3/subscriber_import' \
--header 'Content: application/json' \
--header 'Authorization: Basic {api_key:secret_key}'
--header 'Content-Type: application/json' \
--data-raw '{
"campaign_id": "string",
"carrier_lookup":"boolean",
"duplicate":"string",
"file_url": "string"
}'
| Parameter | Type | Description |
| campaign_id | Required string | Campaign alphanumeric identifier (prefixed with letter 'C') |
| carrier_lookup | Optional boolean | Get carrier info of phone number |
| duplicate | Required string | check a new number and update the old number data or ignore. available values is 'ignore' ,'update' |
| file_url | Required string | File URL to import |
API endpoint:
post
https://api.txt.ws/v3/subscriber_list
Description:
Getting subscriber list.
Request example
curl --location --request POST 'https://api.txt.ws/v3/subscriber_list' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {api_key:secret_key}' \
--data-raw '{
"start_date":"string",
"end_date":"string",
"page_size":"integer",
"page_num":"integer",
"group_id":"string",
}'
| Parameter | Type | Description |
| start_date | Optional string | Start date range |
| end_date | Optional string | End date range |
| page_size | Optional integer | Result page size; integer value |
| page_num | Optional integer | Result page number; integer value |
| group_id | Optional string | Subscriber Group ID |
API endpoint:
post
https://api.txt.ws/v3/subscriber_groups
Description:
Get Subscriber Group List
Request example
curl --location --request POST 'https://api.txt.ws/v3/subscriber_groups' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {api_key:secret_key}' \
--data-raw '{
"start_date":"string",
"end_date":"string",
"page_size":"integer",
"page_num":"integer",
}'
| Parameter | Type | Description |
| start_date | Optional string | Start date range |
| end_date | Optional string | End date range |
| page_size | Optional integer | Result page size; integer value |
| page_num | Optional integer | Result page number; integer value |