开发者文档


Contacts API

TextBoost SMS Contacts API helps you manage contacts that are identified by a unique random ID. Using this ID, you can create, view, update, or delete contacts. This API works as a collection of customer-specific contacts that allows you to group them and assign custom values that you can later use when sending SMS template messages.

The Contacts API uses HTTP verbs and a RESTful endpoint structure with an access key that is used as the API Authorization. Request and response payloads are formatted as JSON using UTF-8 encoding and URL encoded values.

API Endpoint

Markup
https://www.textboostsms.com/api/http/contacts
Parameters
Parameter Required Description
Authorization
Yes
When calling our API, send your api token with the authentication type set asBearer (Example:Authorization: Bearer {api_token})
Accept
Yes
Set toapplication/json
Create a contact

Creates a new contact object. TextBoost SMS returns the created contact object with each request.

API Endpoint

Markup
https://www.textboostsms.com/api/v3/contacts/{group_id}/store
Parameters
Parameter Required Type Description
group_id
Yes
string Contact Groupsuid
phone
Yes
number The phone number of the contact.
first_name
No
string The first name of the contact.
last_name
No
string The last name of the contact.
Example request
PHP
curl-XPOSThttps://gosms.one/api/http/contacts/6065ecdc9184a/store \
                                    -H'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY'\
                                    -H'Content-Type: application/json'\
                                    -H'Accept: application/json'\
                                    -d'{"phone":"8801721970168"}'
Returns

Returns a contact object if the request was successful.

JSON
{
                                    "status":"success",
                                    "data":"contacts data with all details",
                                    }

If the request failed, an error object will be returned.

JSON
{
                                    "status":"error",
                                    "message":"A human-readable description of the error."
                                    }
View a contact

Retrieves the information of an existing contact. You only need to supply the unique contact uid and group uid that was returned upon creation or receiving.

API Endpoint

Markup
https://www.textboostsms.com/api/v3/contacts/{group_id}/search/{uid}
Parameters
Parameter Required Type Description
group_id
Yes
string Contact Groupsuid
uid
Yes
string Contactuid
Example request
PHP
curl-XPOSThttps://gosms.one/api/http/contacts/6065ecdc9184a/search/606732aec8705 \
                                    -H'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY'\
                                    -H'Content-Type: application/json'\
                                    -H'Accept: application/json'\
Returns

Returns a contact object if the request was successful.

JSON
{
                                    "status":"success",
                                    "data":"contacts data with all details",
                                    }

If the request failed, an error object will be returned.

JSON
{
                                    "status":"error",
                                    "message":"A human-readable description of the error."
                                    }
Update a contact

Updates an existing contact. You only need to supply the unique uid of contact and contact group uid that was returned upon creation.

API Endpoint

Markup
https://www.textboostsms.com/api/v3/contacts/{group_id}/update/{uid}
Parameters
Parameter Required Type Description
group_id
Yes
string Contact Groupsuid
uid
Yes
string Contactuid
phone
Yes
number The phone number of the contact.
first_name
No
string The first name of the contact.
last_name
No
string The last name of the contact.
Example request
PHP
curl-XPATCHhttps://gosms.one/api/http/contacts/6065ecdc9184a/update/606732aec8705 \
                                    -H'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY'\
                                    -H'Content-Type: application/json'\
                                    -H'Accept: application/json'\
                                    -d'{"phone":"8801821475168"}'
Returns

Returns a contact object if the request was successful.

JSON
{
                                    "status":"success",
                                    "data":"contacts data with all details",
                                    }

If the request failed, an error object will be returned.

JSON
{
                                    "status":"error",
                                    "message":"A human-readable description of the error."
                                    }
Delete a contact

Deletes an existing contact. You only need to supply the unique contact uid and group uid that was returned upon creation.

API Endpoint

Markup
https://www.textboostsms.com/api/v3/contacts/{group_id}/delete/{uid}
Parameters
Parameter Required Type Description
group_id
Yes
string Contact Groupsuid
uid
Yes
string Contactuid
Example request
PHP
curl-XDELETEhttps://gosms.one/api/http/contacts/6065ecdc9184a/delete/606732aec8705 \
                                    -H'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY'\
                                    -H'Content-Type: application/json'\
                                    -H'Accept: application/json'\
Returns

Returns a contact object if the request was successful.

JSON
{
                                    "status":"success",
                                    "data":"contacts data with all details",
                                    }

If the request failed, an error object will be returned.

JSON
{
                                    "status":"error",
                                    "message":"A human-readable description of the error."
                                    }
View all contacts in group

API Endpoint

Markup
https://www.textboostsms.com/api/v3/contacts/{group_id}/all
Parameters
Parameter Required Type Description
group_id
Yes
string Contact Groupsuid
Example request
PHP
curl-XPOSThttps://gosms.one/api/http/contacts/6065ecdc9184a/all \
                                    -H'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY'\
                                    -H'Content-Type: application/json'\
                                    -H'Accept: application/json'\
Returns

Returns a contact object if the request was successful.

JSON
{
                                    "status":"success",
                                    "data":"contacts data with pagination",
                                    }

If the request failed, an error object will be returned.

JSON
{
                                    "status":"error",
                                    "message":"A human-readable description of the error."
                                    }
Contact groups API
TextBoost SMS Contact Groups API allows you to manage contact groups that are identified by a unique random ID. Use this ID to create, view, update or delete groups.

API Endpoint

Markup
https://www.textboostsms.com/api/http/contacts
Parameters
Parameter Required Description
Authorization
Yes
When calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token})
Accept
Yes
Set to application/json
Create a group

Creates a new group object. TextBoost SMS returns the created group object with each request.

API Endpoint

Markup
https://www.textboostsms.com/api/v3/contacts
Parameters
Parameter Required Type Description
name
Yes
string The name of the group
Example request
PHP
curl -X POST https://gosms.one/api/http/contacts \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
                            -d '{"name":"Codeglen"}'
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "group data with all details",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
View a group

Retrieves the information of an existing group. You only need to supply the unique group ID that was returned upon creation or receiving.

API Endpoint

Markup
https://www.textboostsms.com/api/v3/contacts/{group_id}/show/
Parameters
Parameter Required Type Description
group_id
Yes
string Contact Groups uid
Example request
PHP
curl -X POST https://gosms.one/api/http/contacts/6065ecdc9184a/show \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "group data with all details",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
Update a group

Updates an existing group. You only need to supply the unique ID that was returned upon creation.

API Endpoint

Markup
https://www.textboostsms.com/api/v3/contacts/{group_id}
Parameters
Parameter Required Type Description
group_id
Yes
string Contact Groups uid
name
Yes
string New group name
Example request
PHP
curl -X PATCH https://gosms.one/api/http/contacts/6065ecdc9184a \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
                            -d '{"name":"Codeglen Update"}'
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "groups data with all details",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
Delete a group

Deletes an existing group. You only need to supply the unique id that was returned upon creation.

API Endpoint

Markup
https://www.textboostsms.com/api/v3/contacts/{group_id}
Parameters
Parameter Required Type Description
group_id
Yes
string Contact Groups uid
Example request
PHP
curl -X DELETE https://gosms.one/api/http/contacts/6065ecdc9184a \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "null",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
View all groups

API Endpoint

Markup
https://www.textboostsms.com/api/v3/contacts/
Example request
PHP
curl -X GET https://gosms.one/api/http/contacts \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "group data with pagination",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
SMS API
TextBoost SMS SMS API allows you to send and receive SMS messages to and from any country in the world through a REST API. Each message is identified by a unique random ID so that users can always check the status of a message using the given endpoint.

API Endpoint

Markup
https://www.textboostsms.com/api/http/sms/send
Parameters
Parameter Required Description
Authorization
Yes
When calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token})
Accept
Yes
Set to application/json
Send outbound SMS

TextBoost SMS's Programmable SMS API enables you to programmatically send SMS messages from your web application. First, you need to create a new message object. TextBoost SMS returns the created message object with each request.

Send your first SMS message with this example request.

API Endpoint

Markup
https://www.textboostsms.com/api/http/sms/send
Parameters
Parameter Required Type Description
recipient
Yes
string Number to send message. Use comma (,) to send multiple numbers. Ex. 31612345678,8801721970168
sender_id
Yes
string The sender of the message. This can be a telephone number (including country code) or an alphanumeric string. In case of an alphanumeric string, the maximum length is 11 characters.
type
Yes
string The type of the message. For text message you have to insert plain as sms type.
message
Yes
string The body of the SMS message.
schedule_time
No
datetime The scheduled date and time of the message in RFC3339 format (Y-m-d H:i)
dlt_template_id
No
string The ID of your registered DLT (Distributed Ledger Technology) content template.
Example request for Single Number
PHP
curl -X POST https://gosms.one/api/http/sms/send \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
                            -d '{
                            "recipient":"31612345678",
                            "sender_id":"YourName",
                            "type":"plain",
                            "message":"This is a test message"
                            }'
Example request for Multiple Numbers
PHP
curl -X POST https://gosms.one/api/http/sms/send \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
                            -d '{
                            "recipient":"31612345678,880172145789",
                            "sender_id":"YourName",
                            "type":"plain",
                            "message":"This is a test message",
                            "schedule_time=2021-12-20 07:00"
                            }'
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "sms reports with all details",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
View an SMS

You can use TextBoost SMS's SMS API to retrieve information of an existing inbound or outbound SMS message.

You only need to supply the unique message id that was returned upon creation or receiving.

API Endpoint

Markup
https://www.textboostsms.com/api/v3/sms/{uid}
Parameters
Parameter Required Type Description
uid
Yes
string A unique random uid which is created on the TextBoost SMS platform and is returned upon creation of the object.
Example request
PHP
curl -X GET https://gosms.one/api/http/sms/606812e63f78b \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "sms data with all details",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
View all messages

API Endpoint

Markup
https://www.textboostsms.com/api/v3/sms/
Example request
PHP
curl -X GET https://gosms.one/api/http/sms \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "sms reports with pagination",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
Voice API
TextBoost SMS SMS API allows you to send and receive SMS messages to and from any country in the world through a REST API. Each message is identified by a unique random ID so that users can always check the status of a message using the given endpoint.

API Endpoint

Markup
https://www.textboostsms.com/api/http/sms/send
Parameters
Parameter Required Description
Authorization
Yes
When calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token})
Accept
Yes
Set to application/json
Send outbound SMS

TextBoost SMS's Programmable SMS API enables you to programmatically send SMS messages from your web application. First, you need to create a new message object. TextBoost SMS returns the created message object with each request.

Send your first SMS message with this example request.

API Endpoint

Markup
https://www.textboostsms.com/api/http/sms/send
Parameters
Parameter Required Type Description
recipient
Yes
string Number to send message
sender_id
Yes
string The sender of the message. This can be a telephone number (including country code) or an alphanumeric string. In case of an alphanumeric string, the maximum length is 11 characters.
type
Yes
string The type of the message. For text message you have to insert voice as sms type.
language
Yes
string The language in which the message needs to be read to the recipient. Possible values are: cy-gb, da-dk, de-de, el-gr, en-au, en-gb, en-gb-wls, en-in, en-us, es-es, es-mx, es-us, fr-ca, fr-fr, id-id, is-is, it-it, ja-jp, ko-kr, ms-my, nb-no, nl-nl, pl-pl, pt-br, pt-pt, ro-ro, ru-ru, sv-se, ta-in, th-th, tr-tr, vi-vn, zh-cn, zh-hk.
gender
Yes
string The gender in which the messages needs to be read to the recipient. Possible values are: male, female
message
Yes
string The body of the SMS message.
schedule_time
No
datetime The scheduled date and time of the message in RFC3339 format (Y-m-d H:i)
Example request
PHP
curl -X POST https://gosms.one/api/http/sms/send \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
                            -d '{
                            "recipient":"31612345678",
                            "sender_id":"YourName",
                            "type":"voice",
                            "language=en-gb",
                            "gender=female",
                            "message":"This is a test message"
                            }'
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "sms reports with all details",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
View an SMS

You can use TextBoost SMS's SMS API to retrieve information of an existing inbound or outbound SMS message.

You only need to supply the unique message id that was returned upon creation or receiving.

API Endpoint

Markup
https://www.textboostsms.com/api/v3/sms/{uid}
Parameters
Parameter Required Type Description
uid
Yes
string A unique random uid which is created on the TextBoost SMS platform and is returned upon creation of the object.
Example request
PHP
curl -X GET https://gosms.one/api/http/sms/606812e63f78b \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "sms data with all details",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
View all messages

API Endpoint

Markup
https://www.textboostsms.com/api/v3/sms/
Example request
PHP
curl -X GET https://gosms.one/api/http/sms \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "sms reports with pagination",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
MMS API
TextBoost SMS SMS API allows you to send and receive SMS messages to and from any country in the world through a REST API. Each message is identified by a unique random ID so that users can always check the status of a message using the given endpoint.

API Endpoint

Markup
https://www.textboostsms.com/api/http/sms/send
Parameters
Parameter Required Description
Authorization
Yes
When calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token})
Accept
Yes
Set to application/json
Send outbound SMS

TextBoost SMS's Programmable SMS API enables you to programmatically send SMS messages from your web application. First, you need to create a new message object. TextBoost SMS returns the created message object with each request.

Send your first SMS message with this example request.

API Endpoint

Markup
https://www.textboostsms.com/api/http/sms/send
Parameters
Parameter Required Type Description
recipient
Yes
string Number to send message
sender_id
Yes
string The sender of the message. This can be a telephone number (including country code) or an alphanumeric string. In case of an alphanumeric string, the maximum length is 11 characters.
type
Yes
string The type of the message. For text message you have to insert mms as sms type.
media_url
Yes
url URL's of attachment of the MMS message. Supported media types: image/*
message
No
string The body of the SMS message.
schedule_time
No
datetime The scheduled date and time of the message in RFC3339 format (Y-m-d H:i)
Example request
PHP
curl -X POST https://gosms.one/api/http/sms/send \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
                            -d '{
                            "recipient":"31612345678",
                            "sender_id":"YourName",
                            "type":"mms",
                            "message":"This is a test message",
                            "media_url=https://via.placeholder.com/150.jpg"
                            }'
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "sms reports with all details",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
View an SMS

You can use TextBoost SMS's SMS API to retrieve information of an existing inbound or outbound SMS message.

You only need to supply the unique message id that was returned upon creation or receiving.

API Endpoint

Markup
https://www.textboostsms.com/api/v3/sms/{uid}
Parameters
Parameter Required Type Description
uid
Yes
string A unique random uid which is created on the TextBoost SMS platform and is returned upon creation of the object.
Example request
PHP
curl -X GET https://gosms.one/api/http/sms/606812e63f78b \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
                            }'
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "sms data with all details",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
View all messages

API Endpoint

Markup
https://www.textboostsms.com/api/v3/sms/
Example request
PHP
curl -X GET https://gosms.one/api/http/sms \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "sms reports with pagination",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
Profile API
TextBoost SMS Profile API allows you to retrieve your total remaining sms unit, used sms unit, and your profile information.

API Endpoint

Markup
https://www.textboostsms.com/api/http/me
Parameters
Parameter Required Description
Authorization
Yes
When calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token})
Accept
Yes
Set to application/json
View sms unit

API Endpoint

Markup
https://www.textboostsms.com/api/http/balance
Example request
PHP
curl -X GET https://gosms.one/api/http/balance \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "sms unit with all details",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }
View Profile

API Endpoint

Markup
https://www.textboostsms.com/api/http/me
Example request
PHP
curl -X GET https://gosms.one/api/http/me \
                            -H 'Authorization: Bearer 49|LNFe8WJ7CPtvl2mzowAB4ll4enbFR0XGgnQh2qWY' \
                            -H 'Content-Type: application/json' \
                            -H 'Accept: application/json' \
Returns

Returns a contact object if the request was successful.

JSON
{
                                "status": "success",
                                "data": "profile data with all details",
                            }

If the request failed, an error object will be returned.

JSON
{
                                "status": "error",
                                "message" : "A human-readable description of the error."
                            }

没有找到相关的信息?欢迎联系我们!

请仅依赖我们官方网站发布的信息来获取有关我们业务和服务的准确信息。

订阅 TextBoost SMS 新闻

加入 20000 多人使用的 TextBoost SMS 行列