API Index & API Endpoint

SMS Linker provides a REST API with a secure connection. By using this API, you can manage your account the same way you do on the dashboard. You must enable API (disabled by default) and generate an API Key on the dashboard before you can access this service.
All languages and softwares can use the following API provided that they can make HTTPS requests with POST parameters.

API Endpoint

This API accepts POST HTTPS requests and its endpoint is located at:

https://api.smslinker.com/api/

Authentication

All requests on this API must be identified by your API Key as follows:

https://api.smslinker.com/api/request_you_want_to_do

POST Parameter :

cle : Your API Key

Campaign list

Proceed with the following request:

https://api.smslinker.com/api/campaigns

POST Parameters :

OPTIONAL limitation : specify number of results per page
OPTIONAL page : specify page number

Response

The response will be a JSON object. See the following example:

{"campaigns": [
	  {"ID": "01","Sending_time": "08-06-2017_17:00", "Creating_time": "08-06-2017_17:00", "Status": "ENVOYE","Message":"Go #url# #Var_A# Stop au XXXXX"},
	  {"ID": "01","Sending_time": "08-06-2017_17:00", "Creating_time": "08-06-2017_17:00", "Status": "ENVOYE","Message":"Go #url# #Var_A# Stop au XXXXX"},
	  {"ID": "01","Sending_time": "08-06-2017_17:00", "Creating_time": "08-06-2017_17:00", "Status": "ENVOYE","Message":"Go #url# #Var_A# Stop au XXXXX"},
	  {"ID": "01","Sending_time": "08-06-2017_17:00", "Creating_time": "08-06-2017_17:00", "Status": "ENVOYE","Message":"Go #url# #Var_A# Stop au XXXXX"}
	]
}								
{"campaigns": []}

Campaign information

Proceed with the following request:

https://api.smslinker.com/api/campaign/ID_campaign/informations

Response

The response will be a JSON object. See the following example:

{"campaign":{"Sending_time": "08-06-2017_17:00", "Creating_time": "08-06-2017_17:00", "State": "ENVOYE","Reciptients_amount":"50","Message":"Go #url# #Var_A# Stop au XXXXX"}}
{"campaign": {}}

Campaign recipients

Proceed with the following request:

https://api.smslinker.com/api/campaign/ID_campaign/informations/recipients

Response

The response will be a JSON object. See the following example:

{"recipients":[
	{"ID": "55", "campaign_ID": "01", "State": "Envoye","Phone":"+33606060606","Sending_time":"08-06-2017_17:00","Receiving_time":""},
	{"ID": "55", "campaign_ID": "01", "State": "Recu","Phone":"+33606060606","Sending_time":"08-06-2017_17:00","Receiving_time":""},
	{"ID": "55", "campaign_ID": "01", "State": "Expire","Phone":"+33606060606","Sending_time":"08-06-2017_17:00","Receiving_time":""},
	{"ID": "55", "campaign_ID": "01", "State": "Supprime","Phone":"+33606060606","Sending_time":"08-06-2017_17:00","Receiving_time":""},
	{"ID": "55", "campaign_ID": "01", "State": "Non_Livrable","Phone":"+33606060606","Sending_time":"08-06-2017_17:00","Receiving_time":""},
	{"ID": "55", "campaign_ID": "01", "State": "Inconnu","Phone":"+33606060606","Sending_time":"08-06-2017_17:00","Receiving_time":"08-06-2017_17:00"}
]}
{"recipients": []}

Campaign stops

Proceed with the following request:

https://api.smslinker.com/api/campaign/ID_campaign/informations/stops

Response

The response will be a JSON object. See the following example:

{"stops":[
	{"ID": "55", "campaign_ID": "01","Phone":"+33606060606","Time":"08-06-2017_17:00"},
	{"ID": "55", "campaign_ID": "01","Phone":"+33606060606","Time":"08-06-2017_17:00"}
]}
{"stops": []}

Campaign stats brief (if rich or survey option enabled)

Proceed with the following request:

https://api.smslinker.com/api/campaign/ID_campaign/stats/brief

Response

The response will be a JSON object. See the following example:

{"stats":[
	{"General_Consult": "55", "Unique_Consult": "1","Click_Rate":"98","Android":"5","Apple":"5","Windows":"5","Other":"5"}
]}
{"stats": []}

Campaign stats details (if rich or survey option enabled)

Proceed with the following request:

https://api.smslinker.com/api/campaign/ID_campaign/stats/details

Response

The response will be a JSON object. See the following example:

{"stats":[
	{"ID": "55", "Platform": "Mac 10.11.1","Country":"FR","City":"La Rochelle","Browser":"Safari","Phone":"+33606060606","Time":"08-06-2017_17:00"},
	{"ID": "56", "Platform": "Mac 10.11.1","Country":"FR","City":"La Rochelle","Browser":"Safari","Phone":"+33606060606","Time":"08-06-2017_17:00"}
]}
{"stats": []}

All stops

Proceed with the following request:

https://api.smslinker.com/api/account/stops

Response

The response will be a JSON object. See the following example:

{"stops":[
	{"ID": "55", "campaign_ID": "01","Phone":"+33606060606","Time":"08-06-2017_17:00"},
	{"ID": "55", "campaign_ID": "","Phone":"+33606060606","Time":"08-06-2017_17:00"}
]}
{"stops": []}

Minisite list

Proceed with the following request:

https://api.smslinker.com/api/account/minisites

Response

The response will be a JSON object. See the following example:

{"minisites":[
	{"ID": "0", "Label": "TEST MS","Createdtime":"08-06-2017_17:00"},
	{"ID": "1", "Label": "Test MS2","Createdtime":"08-06-2017_17:00"}
]}
{"minisites": []}

Survey list

Proceed with the following request:

https://api.smslinker.com/api/account/surveys

Response

The response will be a JSON object. See the following example:

{"surveys":[
	{"ID": "0", "Label": "Survey MS","Createdtime":"08-06-2017_17:00"},
	{"ID": "1", "Label": "Survey MS2","Createdtime":"08-06-2017_17:00"}
]}
{"surveys": []}

Survey answers

Proceed with the following request:

https://api.smslinker.com/api/account/survey/Survey_ID/answers

Response

The response will be a JSON object. See the following example:

{"answers":[
	{"ID": "0", "Label": "Answer","Amount":"160"},
	{"ID": "1", "Label": "Answer","Amount":"55"}
]}
{"answers": []}

Campaign answers

Proceed with the following request:

https://api.smslinker.com/api/campaign/ID_campaign/informations/answers

Response

The response will be a JSON object. See the following example:

{"answers":[
	{"ID": "55", "campaign_ID": "01","Phone":"+33606060606","Time":"08-06-2017_17:00","Answer":"this is an answer"},
	{"ID": "55", "campaign_ID": "","Phone":"+33606060606","Time":"08-06-2017_17:00","Answer":"this is an answer"}
]}
{"answers": []}

Campaign delivery receipts

Proceed with the following request:

https://api.smslinker.com/api/campaign/ID_campaign/informations/dreceipts

Response

The response will be a JSON object. See the following example:

{"recipients":[
	{"ID": "55", "campaign_ID": "01", "State": "Recu","Phone":"+33606060606","Sending_time":"08-06-2017_17:00","Receiving_time":"08-06-2017_17:00"},
	{"ID": "56", "campaign_ID": "01", "State": "Recu","Phone":"+33606060606","Sending_time":"08-06-2017_17:00","Receiving_time":"08-06-2017_17:00"},
]}
{"recipients": []}

Credits

Proceed with the following request:

https://api.smslinker.com/api/credits

Response

The response will be a JSON object. See the following example:

{"credits":[
	{"Product_ID": "55", "Product_country": "France", "Amount":"50"},
	{"Product_ID": "55", "Product_country": "France", "Amount":"50"}
]}

White label information

Proceed with the following request:

https://api.smslinker.com/api/whitelabel

Response

The response will be a JSON object. See the following example:

{"Domain": "test.fr", "Enabled": "true", "Name": "my business", "Logo_URL":"50"}

Product list

Proceed with the following request :

https://api.smslinker.com/api/products

Response

The response will be a JSON object. See the following example:

{"products":[
	{"Product_ID": "1", "Product_category": "SMS", "Product_label": "Premium", "Product_country": "France"},
	{"Product_ID": "2", "Product_category": "SMS", "Product_label": "Low cost", "Product_country": "France"}
]}

Country list

Proceed with the following request :

https://api.smslinker.com/api/countries

Response

The response will be a JSON object. See the following example:

{"Countries":[
	{"Country_ID": "1","Country_label": "France"},
	{"Country_ID": "2", "Country_label": "UK"}
]}

Send a message:

Proceed with the following request:

https://api.smslinker.com/api/message/send

POST Parameters :

product_id :
senderlabel : sender name ( if SMS premium or SMS International) Max 11 char
content : message content
manual_recipients : recipients list separate by a comma (Optional)
phonebooks : Phonebooks'id(Optional)
country_id (optional) : if SMS International, you must define an country
dynamicvars (optional) : 1 = Enable the dynamic vars of your phonebook ,default it's disabled. /!\ IF YOU ENABLE THIS, MANUAL RECIPTIENTS ARE DISABLED /!\
senddate (optional) : sending date (YYYY-mm-dd_H:i)						
richtype (optional) : Type 1 = Rich SMS, Type 2 = Minisite, Type 3 = Survey
richurlconf (optional) : 0 = One URL For all of you customers, 1 = One URL per customer
richurlorigin (optional) : If richurlconf = 1, you can custom you url shortner
destination_url (optional) : If your rich sms type is 1, the full url where your customers are redirected						
minisite_id (optional) : If your rich sms type is 2, your minisite ID						
survey_id (optional) : If your rich sms type is 3, your survey ID

Errors

Error Reason How to fix
MISSING_CONTENTYour message content is emptyProvide a message content.
PHONEBOOK_ID_NOT_NUMERICThe Phonebook ID is not numericProvide a numeric phonebook ID
PHONEBOOK_NOT_FOUNDThe Phonebook ID does not exitProvide a valid phonebook ID
MISSING_PRODUCTThe value of product ID is missingProvide a valid product ID
NO_PRODUCT_FOUNDProduct does not existProvide a valid product ID
MISSING_SENDERLABELYour forgot to provide a sender labelProvide a sender label
TOOLONG_SENDERLABELSender label is too long.Your sender label must be shorter than 11 characters
DATE_FORMATProvided date is invalidFormat your date as specified in the documentation
PAST_DATEProvided date is before current dateThe provided date is in the past
INVALID_RICH_TYPEThe rich type provided is invalidProvide a rich type as specified in the documentation
MISSING_DESTINATION_URLDestination URL of rich sms is missingProvide a rich destination URL
MISSING_MINISITEYou have enabled rich sms and want to use minisite but, you have not provided a minisite IDProvide minisite ID
NOT_FOUND_MINISITEYou have enabled rich sms and want to use minisite but the provided minisite ID does not existProvide a valid minisite ID
MISSING_MINISITEYou have enabled rich sms and want to use survey but you have not provided a survey iDProvide a valid survey ID
INVALID_RICHURLCONFInvalid rich URL configuration, this must be 1 OR 0 as specified in the documentation
MESSAGE_TOOLONGMessage is too long, max is 349 characters (3 SMS - Premium or International) OR 160 characters (1 Lowcost SMS)
NO_ENOUGHT_CREDITYou do not have enough credits on your account, please order new ones.
EMPTY_RECIPIENT_LISTYour recipient list is empty or contain malformed phonenumber, we can't send your campain.

Response

The response will be a JSON object. See the following example:

{"RESULT":"SUCCESS"}
{"ERROR":"ERROR_LABEL"}

Phonebook list

Proceed with the following request:

https://api.smslinker.com/api/phonebooks

Response

The response will be a JSON object. See the following example:

{"phonebooks": [
	  {"ID": "1", "Label": "Test", "Temporary": "true","Amount":"50000"},
	]
}								
{"phonebooks": []}

Contact list

Proceed with the following request:

https://api.smslinker.com/api/phonebook/PHONEBOOK_ID/contacts

Response

The response will be a JSON object. See the following example:

{"contacts": [
	  {"ID": "1", "Phonebook_ID": "1", "Country": "France","Phone":"+33606060606"},
	  {"ID": "1", "Phonebook_ID": "1", "Country": "France","Phone":"+33606060606"},
	  {"ID": "1", "Phonebook_ID": "1", "Country": "France","Phone":"+33606060606"},
	  {"ID": "1", "Phonebook_ID": "1", "Country": "France","Phone":"+33606060606"}
	]
}								
{"contacts": []}

How to delete a phonebook

Proceed with the following request:

https://api.smslinker.com/api/phonebook/PHONEBOOK_ID/delete

Response

The response will be a JSON object. See the following example:

{"result":true"}
{"result":false"}

How to delete a contact in a phonebook

Proceed with the following request:

https://api.smslinker.com/api/phonebook/PHONEBOOK_ID/contact/CONTACT_ID/delete

Response

The response will be a JSON object. See the following example:

{"result":true"}
{"result":false"}

Create a STOP

Proceed with the following request:

https://api.smslinker.com/api/stop/createPOST : Phonenumber

POST Parameters :

Phonenumber : Phone number must be set in international format.

Response

The response will be a JSON object. See the following example:

{"result":true"}
{"result":false"}

Errors

Error Reason How to fix
NOT_FOUNDYour API Key is not validGet an API Key from your dashboard.
API_DISABLEDThe API is disabled on your accountActivate the API for your account from the dashboard.
ACCOUNT_NOT_ACTIVATEDYour account is not activated.Please activate your account.
ACCOUNT_BANNEDYour account is bannedPlease contact an administrator.
IP_BANNEDThe IP address sending the request has been banned.Please contact an administrator.