The /GDPR_MSG/ endpoint sends an SMS containing a verification code to a phone number, along with the selected GDPR communication consent channels.
GDPR_MSG to send a one-time SMS verification
code to a phone number. Once the user replies with the code,
verify it using
SMS Phone Confirmation API — Verify OTP (/GDPR_VERIF/) →
/GDPR_MSG/
Request
Both GET and POST are supported.
Code examples
Send a verification code
Send all parameters in the request body using
Content-Type: application/x-www-form-urlencoded.
The server address remains in the URL.
Code examples
Send a verification code
Parameters
| Parameter | Description | Mand / Opt |
|---|---|---|
| Licence | Licence code assigned to your account. | Mandatory |
| Phone |
Phone number in international format, without
the + prefix and without spaces
(for example, 44XXXXXXXXXX for the
United Kingdom).
|
Mandatory |
| Country | ISO 3-letter country code. | Mandatory |
| Company | Company name used as the SMS sender. Minimum 3 characters and maximum 11 characters. | Mandatory |
| Custom_sms | Custom SMS content. Limited to 125 characters. The verification code is automatically appended. | Mandatory |
| Duration | Validity duration of the SMS code, in minutes. | Optional |
| Phonecom |
1 or 0. Indicates whether
phone communication consent was selected.
|
Optional |
1 or 0. Indicates whether
email communication consent was selected.
|
Optional | |
| Post |
1 or 0. Indicates whether
postal communication consent was selected.
|
Optional |
| Sms |
1 or 0. Indicates whether
SMS communication consent was selected.
|
Optional |
Phonecom,
Email, Post and Sms
parameters are each optional, but at least one of them must
be set to 1 — the request fails with error code
11 if none is enabled.
Optional multi-contact consent parameters:SMS2–SMS5,
PHONE2–PHONE5,
EMAIL2–EMAIL5, POST2–POST5
(consent for secondary contacts, same 1/0
format as the primary channels above).
Response
The JSON response contains the SMS delivery status and verification metadata.
| Key | Description | Type |
|---|---|---|
| status | SMS delivery status. See the Status values table below. | String |
| timeout | Validity duration of the code in minutes. | String |
| companyName | Company name used as the sender. | String |
| country | ISO 3-letter country code. | String |
| to | Recipient phone number in international format. | String |
| channels | Selected communication channels. | Object |
| errors | Error details. See the Error codes table below. | Object |
| smsToken |
Unique identifier of the SMS. Pass this value
to GDPR_VERIF as the Token parameter.
|
String |
| dateTime | Date and time the SMS was sent. | String |
Status values
| Status | Description |
|---|---|
PENDING
|
The SMS was sent to the operator. |
DELIVERED
|
The SMS was successfully delivered. |
UNDELIVERABLE
|
The SMS could not be delivered. |
EXPIRED
|
The SMS expired before delivery confirmation. |
REJECTED
|
The SMS was rejected by the operator. |
Error codes
| Code | Description |
|---|---|
00
|
No errors. |
01
|
Missing parameters. |
02
|
Service not authorized for this licence. |
03
|
Invalid phone number. |
04
|
Invalid country code. |
05
|
Invalid duration. |
06
|
Country not found. |
07
|
Invalid company name. |
08
|
Internal API error. |
09
|
No delivery status received. |
10
|
Invalid consent values. |
11
|
At least one communication channel must be enabled. |
Response example
Successful delivery
Test the API
Click the button below to test this endpoint live in your browser.
Open console
See also
Related to