API SMS PRO Documentation

If you have a specific need, contact us!

Versions

NumModificationsDate of application
1.0.0Initial version
1.1.0
  • Commercial messages must include the words ‘STOP sms-s.top’.
  • Error code added : 400 – STOP mention missing
16/12/2021
1.1.111/07/2022
1.1.2

Documentation update. Your existing integrations will continue to work without any changes.

  • SMS status (getstatus): the parameter to use is api_id (or climsgid). The OpenAPI specification mistakenly listed apimsgid, which is ignored. If you generated your client from this specification, please regenerate it.
  • Sending to several recipients: separate the numbers with commas. The response contains one ID per SMS (ID:<id1>,<id2>), or an error in place of the ID of a refused SMS.
  • Sender ID (from): 3 to 11 characters (unaccented letters, digits and spaces), including at least one letter.
  • Error 100: two cases are now detailed: Incorrect phone number (no valid number) and Text empty after transformation (none of the characters in the text are supported; this case previously returned error 300).
  • Error 400: for a commercial message to metropolitan France, a missing STOP mention is added automatically if it fits in the SMS. The error is returned only if it does not fit.
  • HTTP codes: API errors are returned with HTTP 200, in the form
  • Status callback (DLR): only final statuses are sent.
  • OpenAPI specification: upgraded to OpenAPI 3.2.1. Status and reply callbacks are now described as webhooks. Please check that your tools support this version.
    The backup server api2 and the test number 999 have been added to the specification.
25/11/2026

1. Introduction

The HTTP API is the easiest way to use TextingHouse’s SMS communication portal.

This interface must be used with HTTP POST. GET is deprecated and intended for testing only.

TextingHouse’s responses to these queries are plain text (content-type: text/plain; charset=utf-8). For example the ID of the SMS created, the SMS status code, the credit value, an error code… They are inserted directly into the HTTP body of the response, without any particular tag.

Communication with our API is done over HTTPS on port 443.

Note: It is important that the entire document is read before contacting support. All of the examples shown in this document use HTTP GET.

2. Prerequisites

In order to use the SMS sending API you first need an active customer account with positive credit on the TextingHouse systems. The identifiers will be replaced by ‘XXXX‘ in the code examples that follow. To register, it’s here: Register – API TextingHouse.

3. Examples

Below are basic implementation examples for sending an SMS via the TextingHouse API. The parameters are case sensitive.

GET basic command example

GET:

https://api.textinghouse.com/http/v1/do?user=XXXX&pass=XXXX&cmd=sendsms&to=999&txt=XXXXX&iscom=N

Return example:

ID:5d726149a129c829e8c23f7b
Javascript Node.js example - axios

axios:

const axios = require('axios');    

axios({
  method: 'post',
  url: 'https://api.textinghouse.com/http/v1/do',
  data: {
    user: 'XXXX',
    pass: 'XXXX',
    cmd: 'sendsms',
    to: '999',
    txt: 'My test SMS',
    iscom: 'N'
  },
  responseType: 'text'
})
.then((res) => {
  console.log(res.data)
})
.catch((error) => {
  console.error(error)
});
PHP example - cURL

cURL:

$data = array(
    'user' => 'XXXX',
    'pass' => 'XXXX',
    'cmd' => 'sendsms',
    'to' => '999',
    'txt' => 'My test SMS',
    'iscom' => 'N'
);
$url = 'https://api.textinghouse.com/http/v1/do';
$ch = curl_init($url);
$postString = http_build_query($data, '', '&');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

4. How the API works

4.1 Authentication

Once your account is created on TextingHouse API, your login details are available on the “Options” page:

  • user : the username provided to you for the http TextingHouse API
  • pass : the password associated with the username

An IP lock can also be added via the “Options” > “IP lock” page in order to allow sending only from a specific IP address: this is recommended.

4.2 Commands

The commands are specified via the « cmd » parameter. The possible values are:

cmd valueAdditional parametersDescription
sendsmsyesCommand used for sending SMS. See Send SMS
getstatusyesGet the status of a message via its ID. See Get SMS status
getcreditnoGet customer account actual credit. See Consult your credit balance

4.3 Send SMS

Sending a message is done using the command « sendsms »:

&cmd=sendsms

The parameters of the « sendsms » command are as follows:

ParameterMandatoryDescription
toyes

Recipient’s phone number in international format, prefixed by the country code (e.g. 33 for France). The national format is accepted for the country of the account.

For several recipients, separate the numbers with commas. Invalid numbers are discarded.

txtyes

Message text.
The text should be “URL Encoded”.
Note that some special characters may be replaced depending on the SMS destination network.
See 5.3 Allowed characters in SMS

climsgidnoMessage client ID Defined by customer to get follow-up. Up to 32 characters.
fromnoAllows you to customize the sender ID of the SMS. Sender ID personalization is restricted to a set of names authorized for your account. Requests are made via the “Options” page of the API interface.

3 to 11 characters: unaccented letters, digits and spaces, including at least one letter.

The personalization of the sender ID is not possible for certain destinations (technical restriction of certain operators). TextingHouse reserves the right to replace the sender chosen by the customer at the time of sending.

iscomyesIndicates whether it is a commercial message or not. Possible value:

  • ‘Y’ for: Yes, this is a commercial message
  • ‘N’ for: No, this is not a commercial message

 

Commercial messages must be sent on working days and during the day. The authorized slots (according to the local time of the recipient) are therefore as follows:

  • Monday to Friday between 8 a.m. and 8 p.m.,
  • Saturday between 10 a.m. and 3 p.m.

Commercial messages on Sundays and public holidays are not permitted.

Text messages of a commercial nature sent outside the authorized time slots will be retained and sent at the next working hour without the customer being able to issue a complaint or cancellation of sending.

Each commercial message must also:

  • specify the identity of the advertiser,
  • include the mention ‘STOP sms-s.top’

See detail below: Commercial / marketing SMS

Example of sending an SMS containing the message « SMS accentué de test via TextingHouse » to the French number  with the client ID « FRS78913246 »:

https://api.textinghouse.com/http/v1/do?user=XXXX&pass=XXXXXX&cmd=sendsms&to=33628000000&txt=SMS%20accentu%C3%A9%20de%20test%20via%20TextingHouse&climsgid=FRS78913246&from=test&iscom=N

Response:

ID:<api_id> (TextingHouse ID)

Example:

ID:5d726149a129c829e8c23f7b

Following a sending, the API provides the message ID, which confirms that the message has been properly handled. This ID will be necessary for you to correlate the feedback of statuses and the messages sent.

Or, in case of error:

ERR: <error_code> | error description

Example:

ERR: 101 | Authentication failed

In the event of an error, the following codes must be taken into consideration:

Error codeDescription
100Missing or invalid parameter, no valid phone number, or text empty after conversion
101Authentication failure: invalid username, password or IP address
104Insufficient credit
300Error processing request
350Stop flooding. Only one message (same content, same telephone number) per recipient is authorized per 10 seconds. Beyond this limit, the API returns this error.
400STOP mention missing and impossible to add automatically

 

For several recipients, the response contains one ID per SMS, in the order of the valid numbers: ID:<id1>,<id2>,.... The ID of a refused SMS is replaced by ERR: <code> | <label>.

 

Commercial / marketing SMS

The parameter « iscom » (mandatory) of the « sendsms » command indicates if your SMS is commercial (or marketing), or if it is a service message.

 

Reminder of the CNIL rules concerning commercial SMS:

SMS advertising is possible in France provided that people have explicitly given their consent to be canvassed when collecting their mobile phone number.

Each commercial message must:

  • specify the identity of the advertiser,
  • provide a simple way to object to receiving new solicitations (STOP SMS).
  • be sent only on working days and during the day.

 

STOP SMS

All commercial SMS (iscom = Y) must include the mention ‘STOP sms-s.top’ at the end of the text of your message.

TextingHouse will then automatically collect STOP SMS from your recipients to allow them to unsubscribe from your communications.

If a commercial SMS does not contain the mention ‘STOP sms-s.top’, it will be refused (error 400).

 

Time restrictions:

The rules for prospecting by SMS define that messages of a commercial nature must be sent on working days and during the day. The slots allowed by TextingHouse are therefore as follows:

  • Monday to Friday between 8 a.m. and 8 p.m.
  • Saturday between 10 a.m. and 3 p.m.

Commercial messages are not permitted on Sundays or public holidays.

Text messages of a commercial nature sent outside the authorized time slots will be retained and sent at the next working hour without the customer being able to issue a complaint or cancellation.

 

SMS cost

Each SMS sent to the API (except test SMS sent to 999), is billed at the rate in effect at the time of sending. If the SMS exceeds 160 characters, each additional SMS will be counted according to the cutting of the SMS (see FAQ What size of message can I send by SMS ?).

4.4 Get SMS status

We recommend the use of automatic status reporting via the callback URL: see Status callback. However, it is possible to request the status of a message by specifying its TextingHouse ID or its customer ID with the command « getstatus » :

&cmd=getstatus

The parameters are as follows:

ParameterDescription
api_idTextingHouse ID returned by the API when sending
climsgidCustomer ID provided when sending

At least one of the two parameters, api_id or climsgid, is required. If both are provided, only api_id is taken into account.

https://api.textinghouse.com/http/v1/do?user=XXXX&pass=XXXX&cmd=getstatus&api_id=5d726149a129c829e8c23f7b

Or

https://api.textinghouse.com/http/v1/do?user=XXXX&pass=XXXXXX&cmd=getstatus&climsgid=FRS78913246

Response:

<status_code>

Example:

3

Status codes: see Status dode Error code:

Error codeDescription
100Missing or invalid parameter (including an api_id in an incorrect format)
101Authentication failure: invalid username, password or IP address
201api_id unknown
202climsgid unknown
300Error processing request

4.5 Status callback

The TextingHouse API will send the statuses with HTTP POST containing the status in JSON format on a URL provided by the client (callback URL). This URL configuration is done on the API interface page “Options” > “DLR and MO callbacks”.

For example if the entered callback URL is https://www.mysite.com/myscript.do, the request made by TextingHouse will be:

POST https://www.mondomaine.com/monscript.do HTTP/1.1
Content-Type: application/json

{
  "apimsgid": "5d726149a129c829e8c23f7b",
  "climsgid": "FR-6468446",
  "status": "3"
}

With the following parameters:

  • apimsgid: TextingHouse ID returned by the API when sending (string)
  • climsgid: Optional customer ID provided when sending (string)
  • status: SMS status (string) – code list: see Status codes

The client-side script should respond with a 2XX HTML status code. The response body is not processed by TextingHouse.

4.6 SMS replies callback (SMS MO)

The TextingHouse API will send the SMS replies* with HTTP POST containing the SMS reply in JSON format on a URL provided by the client (SMSMO callback URL). This URL configuration is done on the API interface page “Options” > “DLR and MO callbacks”.

* Depending on the operators and the sending countries. Warning, when a sender ID name is used (parameter ‘from’ in ‘sendsms’ command), the recipients cannot reply to SMS.

For example if the entered callback URL is https://www.mysite.com/myscript.do, The request made by TextingHouse will be:

POST https://www.mondomaine.com/monscript.do HTTP/1.1
Content-Type: application/json

{
  "apimsgid": "5d726149a129c829e8c23f7b",
  "climsgid": "FR-6468446",
  "from": "33600000000",
  "txt": "Texte du message",
  "date": "2019-04-01T13:09:16Z"
}

With the following parameters:

  • apimsgid: TextingHouse ID returned by the API when sending (string)
  • climsgid: Optional customer ID provided when sending (string)
  • from: phone number of the message sender (string)
  • txt: the message (string)
  • date: message UTC date, format YYYY-MM-DD HH:mm:ss (string)

The client-side script should respond with a 2XX HTML status code. The response body is not processed by TextingHouse.

4.7 Consult your credit balance

Get your credit balance with command getcredit :

&cmd=getcredit

Example :

https://api.textinghouse.com/http/v1/do?user=XXXX&pass=XXXXXX&cmd=getcredit

Return:

<credit>

Example :

1423

4.8 Test SMS to 999

Sending an SMS to the number 999 is a simple way to test the API for both development and service monitoring. Sending an SMS to this number is subject to authentication as for sending a standard SMS to a “classic” recipient. Note that SMS sent to 999 are not charged. The API will support these tests in the same way as standard SMS (see Send SMS, Get SMS status et Status callback), this implies in particular:

  • The return of a message id.
  • Support for your internal id (optional).
  • The transmission of an acknowledgment of receipt in “delivered” status. Note that this virtual acknowledgment of receipt is generated at the end of the test (the SMS is not delivered to an operator) but nevertheless reflects the proper functioning of our sending chain and in particular the communication between the API front-ends and our platforms of consignments.
  • The response to the status query on this message ID.

The content of the test SMS is free and not taken into account. Credit, empty text and flood checks also apply to messages sent to 999: the account must have a positive credit (except postpaid accounts), the text must not be empty after conversion, and the same text cannot be sent twice within the same 10-second period.

4.9 Ensure Service Continuity with API Redundancy

As part of the integration with our SMS API, we strongly recommend implementing an automatic failover mechanism in your development.

In practice, if a request to the primary URL api.textinghouse.com does not succeed (no response), we advise your system to immediately retry the same request on our backup server api2.textinghouse.com.

This best practice ensures greater fault tolerance and optimal service continuity for your application, even in the event of temporary unavailability of the primary frontend.

5. Appendices

5.1 Status codes

Status codeStatus typeDescription
0temporaryProcessing in progress
1temporaryIn progress: SMS sent, awaiting final status.
3finalSMS received
4finalExpired or out of reach
5finalNot subscribed
6finalSMS not received”
7finalProhibited sending
20finalInsufficient credit

5.2 Error codes

Error codeDescription
100Missing or invalid parameter (Invalid query), no valid phone number (Incorrect phone number), or text empty after conversion (Text empty after transformation)
101Authentication failure: invalid username, password or IP address
104Insufficient credit
201Unknown api_id
202Unknown climsgid
300Error processing request
350Flood detected. Only one message (same content, same telephone number) per recipient is authorized per 10 seconds. Beyond this limit, the API returns this error.
400STOP mention missing and impossible to add automatically

5.3 Caractères autorisés dans les SMS

The text can be checked with the following regular expression (JavaScript):

/^[ 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZÄäàÅ寿ßÇèéÉìÖöòØøÑñÜüù#¤%&()*+,\-_./:;<>=§$!?£¿·@¡'"\n\[\]{}~^|]+$/

Messages containing other characters are not refused: these characters are converted (e.g. ê to e, € to E) or removed if they have no equivalent.