SMS Messaging
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:
post
https://api.txt.ws/v3/sendsms
Description:
Send a text (SMS) or multi-media message (MMS)
Request example
curl --location --request POST 'https://api.txt.ws/v3/sendsms' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {api_key:secret_key}' \
--data-raw '{
"from":"string",
"to":"string",
"text":"string",
"media":"string",
"notifyurl":"string",
"reference":"string"
}'
| Parameter | Type | Description |
| from | Required string | your SMS enabled phone number |
| to | Required string | destination number |
| text | Required string | text message we will be sending |
| media | Optional string | base64 encoded image (jpg/png) |
| notifyurl | Optional string | if provided, we will post back any status changes to this URL. (example: https://customer-crm.xyz/notify-handler ) |
| reference | Optional string | your own reference ; will be useful since you might have several messages with the same from/to parameters,passing the reference parameter will help you identify which message the status update is for... |
| analytics | Optional integer | Perform messaging analytics,available values is 1 or 0. |
| carrier_lookup | Optional integer | Perform Carrier Lookup - price is $0.004 per phone number,available values is 1 or 0. |
API endpoint:
post
https://api.txt.ws/v3/send_campaign_msg
Description:
Send campaign messages
Request example
curl --location --request POST 'https://api.txt.ws/v3/send_campaign_msg' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {api_key:secret_key}' \
--data-raw '{
"campaignId":"string",
"content":"string",
"subscriber_group":"string",
"send_localtime":"boolean",
"send_immediately":"string",
"template_id":"string",
"shorten_url":"boolean",
"domain_id":"string",
"analytics":"boolean",
"scheduled_date":"string",
}'
| Parameter | Type | Description |
| campaignId | Required string | Campaign alphanumeric identifier (prefixed with letter 'C') |
| content | Required string | Text message we will be sending |
| subscriber_group | Optional string | Subscriber group id |
| send_localtime | Optional string | Available values is 0 or 1,If value is true,it will start sending at local time for each subscriber |
| scheduled_date | Optional string | Scheduled Date |
| send_immediately | Optional string | Available values is 0 or 1,if value is 1,it will send message immediately. |
| template_id | Optional string | Message template id to send |
| shorten_url | Optional string | Set if you want to shorten the URLs in the message content. |
| domain_id | Optional string | Setting the domain to use for URL shortening |
| analytics | Optional string | Send unique URLs to each subscriber |
API endpoint:
get
https://api.txt.ws/v3/get_campaign_msg/{message_id}
Description:
Getting campaign message.
Request example
curl --location --request POST 'https://api.txt.ws/v3/get_campaign_msg/JE2C6EOJ' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {api_key:secret_key}' \
| Parameter | Type | Description |
| message_id | Required string | Campaign Message ID |