SMS Phone Confirmation API — Verify OTP

Support DQE
Support DQE
  • Updated
SMS Phone Confirmation API

The /GDPR_VERIF/ endpoint verifies the PIN code entered by the user against the token returned by a prior GDPR_MSG request.

When to use this endpoint - Call GDPR_VERIF to check the PIN a user received by SMS. You must first obtain a token by calling SMS Phone Confirmation API — Send OTP (/GDPR_MSG/) →

/GDPR_VERIF/

Request

Both GET and POST are supported.

{SERVER_ADDRESS} is provided by DQE upon account creation. Contact your DQE account manager to obtain it.
GEThttps://{SERVER_ADDRESS}/GDPR_VERIF/?Phone={PHONE}&Token={SMS_TOKEN}&Pin={CODE_PIN}

Code examples

Verify a PIN code

curl "https://{SERVER_ADDRESS}/GDPR_VERIF/?Phone=33612345678&Token=C6hfYZIER3CVoGVYwTiZLg&Pin=123456"
fetch("https://{SERVER_ADDRESS}/GDPR_VERIF/?" + new URLSearchParams({ Phone: "33612345678", Token: "C6hfYZIER3CVoGVYwTiZLg", Pin: "123456" })) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.get( "https://{SERVER_ADDRESS}/GDPR_VERIF/", params={ "Phone": "33612345678", "Token": "C6hfYZIER3CVoGVYwTiZLg", "Pin": "123456", }, ) print(response.json())
<?php $params = http_build_query([ 'Phone' => '33612345678', 'Token' => 'C6hfYZIER3CVoGVYwTiZLg', 'Pin' => '123456', ]); $ch = curl_init("https://{SERVER_ADDRESS}/GDPR_VERIF/?{$params}"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true);
const axios = require('axios'); axios.get('https://{SERVER_ADDRESS}/GDPR_VERIF/', { params: { Phone: '33612345678', Token: 'C6hfYZIER3CVoGVYwTiZLg', Pin: '123456' } }) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String url = "https://{SERVER_ADDRESS}/GDPR_VERIF/" + "?Phone=33612345678&Token=C6hfYZIER3CVoGVYwTiZLg&Pin=123456"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .GET() .build(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body());
using var client = new HttpClient(); var url = "https://{SERVER_ADDRESS}/GDPR_VERIF/" + "?Phone=33612345678&Token=C6hfYZIER3CVoGVYwTiZLg&Pin=123456"; var response = await client.GetAsync(url); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
package main import ( "fmt" "io" "net/http" ) func main() { url := "https://{SERVER_ADDRESS}/GDPR_VERIF/" + "?Phone=33612345678&Token=C6hfYZIER3CVoGVYwTiZLg&Pin=123456" resp, err := http.Get(url) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) }
POSThttps://{SERVER_ADDRESS}/GDPR_VERIF/

Send all parameters in the request body using Content-Type: application/x-www-form-urlencoded. The server address remains in the URL.

Code examples

Verify a PIN code

curl -X POST "https://{SERVER_ADDRESS}/GDPR_VERIF/" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "Phone=33612345678" \ -d "Token=C6hfYZIER3CVoGVYwTiZLg" \ -d "Pin=123456"
fetch("https://{SERVER_ADDRESS}/GDPR_VERIF/", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ Phone: "33612345678", Token: "C6hfYZIER3CVoGVYwTiZLg", Pin: "123456" }) }) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.post( "https://{SERVER_ADDRESS}/GDPR_VERIF/", data={ "Phone": "33612345678", "Token": "C6hfYZIER3CVoGVYwTiZLg", "Pin": "123456", }, ) print(response.json())
<?php $ch = curl_init("https://{SERVER_ADDRESS}/GDPR_VERIF/"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ 'Phone' => '33612345678', 'Token' => 'C6hfYZIER3CVoGVYwTiZLg', 'Pin' => '123456', ])); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true);
const axios = require('axios'); const qs = require('querystring'); axios.post('https://{SERVER_ADDRESS}/GDPR_VERIF/', qs.stringify({ Phone: '33612345678', Token: 'C6hfYZIER3CVoGVYwTiZLg', Pin: '123456' })) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String form = "Phone=33612345678&Token=C6hfYZIER3CVoGVYwTiZLg&Pin=123456"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{SERVER_ADDRESS}/GDPR_VERIF/")) .header("Content-Type", "application/x-www-form-urlencoded") .POST(HttpRequest.BodyPublishers.ofString(form)) .build(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body());
using var client = new HttpClient(); var form = new Dictionary<string, string> { ["Phone"] = "33612345678", ["Token"] = "C6hfYZIER3CVoGVYwTiZLg", ["Pin"] = "123456" }; var response = await client.PostAsync( "https://{SERVER_ADDRESS}/GDPR_VERIF/", new FormUrlEncodedContent(form)); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
package main import ( "fmt" "io" "net/http" "net/url" ) func main() { form := url.Values{} form.Set("Phone", "33612345678") form.Set("Token", "C6hfYZIER3CVoGVYwTiZLg") form.Set("Pin", "123456") resp, err := http.PostForm("https://{SERVER_ADDRESS}/GDPR_VERIF/", form) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) }

Parameters

Parameter Description Mand / Opt
Phone Phone number in international format, without the + prefix and without spaces (for example, 44XXXXXXXXXX for the United Kingdom). Mandatory
Token Identifier returned by the GDPR_MSG request (smsToken field). Mandatory
Pin 6-digit verification code received by the user via SMS. Mandatory

Response

Key Description Type
status OK if the PIN is valid, KO otherwise. String
phone Phone number in international format. String
dateTime Verification date and time. String
channels Selected communication channels. Object
errors Error details. See the Error codes table below. Object

Error codes

Code Description
00 No errors.
01 Missing parameters.
02 PIN must contain 6 digits.
03 PIN expired.
04 PIN invalid for this token or phone number.
05 Invalid token.

Response example

Valid PIN
{ "status": "OK", "phone": "33631525429", "errors": { "00": "00 - No errors" }, "channels": { "phone": 0, "post": 0, "sms": 1, "email": 1 }, "dateTime": "2019-07-29 11:34:48.998397" }

Test the API

Click the button below to test this endpoint live in your browser.

Open console

See also

Related to

Was this article helpful?

0 out of 0 found this helpful