SMS Phone Confirmation API — OTP senden

Support DQE
Support DQE
  • Aktualisiert
SMS Phone Confirmation API

Der Endpunkt /GDPR_MSG/ sendet eine SMS mit einem Verifizierungscode an eine Telefonnummer, zusammen mit den ausgewählten DSGVO-Kommunikationseinwilligungskanälen.

Wann dieser Endpunkt verwendet wird – Rufen Sie GDPR_MSG auf, um einen einmaligen SMS-Verifizierungscode an eine Telefonnummer zu senden. Sobald der Nutzer mit dem Code antwortet, überprüfen Sie ihn mit SMS Phone Confirmation API — OTP überprüfen (/GDPR_VERIF/) →

/GDPR_MSG/

Anfrage

Sowohl GET als auch POST werden unterstützt.

{SERVER_ADDRESS} und {LICENCE_CODE} werden von DQE bei der Kontoerstellung bereitgestellt. Wenden Sie sich an Ihren DQE-Kundenbetreuer, um diese Zugangsdaten zu erhalten.
GEThttps://{SERVER_ADDRESS}/GDPR_MSG/?Phone={PHONE}&Duration={DURATION}&Custom_sms={CUSTOM_SMS_CONTENT}&Phonecom={VALUE_PHONECOM}&Email={VALUE_EMAIL}&Post={VALUE_POST}&Sms={VALUE_SMS}&Country={COUNTRY_CODE}&Licence={LICENCE_CODE}&Company={COMPANY_NAME}

Codebeispiele

Verifizierungscode senden

curl "https://{SERVER_ADDRESS}/GDPR_MSG/?Licence={LICENCE_CODE}&Phone=33612345678&Country=FRA&Company=MYCOMPANY&Custom_sms=Your%20confirmation%20code%20is"
fetch("https://{SERVER_ADDRESS}/GDPR_MSG/?" + new URLSearchParams({ Licence: "{LICENCE_CODE}", Phone: "33612345678", Country: "FRA", Company: "MYCOMPANY", Custom_sms: "Your confirmation code is" })) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.get( "https://{SERVER_ADDRESS}/GDPR_MSG/", params={ "Licence": "{LICENCE_CODE}", "Phone": "33612345678", "Country": "FRA", "Company": "MYCOMPANY", "Custom_sms": "Your confirmation code is", }, ) print(response.json())
<?php $params = http_build_query([ 'Licence' => '{LICENCE_CODE}', 'Phone' => '33612345678', 'Country' => 'FRA', 'Company' => 'MYCOMPANY', 'Custom_sms' => 'Your confirmation code is', ]); $ch = curl_init("https://{SERVER_ADDRESS}/GDPR_MSG/?{$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_MSG/', { params: { Licence: '{LICENCE_CODE}', Phone: '33612345678', Country: 'FRA', Company: 'MYCOMPANY', Custom_sms: 'Your confirmation code is' } }) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String url = "https://{SERVER_ADDRESS}/GDPR_MSG/" + "?Licence={LICENCE_CODE}&Phone=33612345678&Country=FRA&Company=MYCOMPANY&Custom_sms=Your+confirmation+code+is"; 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_MSG/" + "?Licence={LICENCE_CODE}&Phone=33612345678&Country=FRA&Company=MYCOMPANY&Custom_sms=Your+confirmation+code+is"; 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_MSG/" + "?Licence={LICENCE_CODE}&Phone=33612345678&Country=FRA&Company=MYCOMPANY&Custom_sms=Your+confirmation+code+is" 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_MSG/

Senden Sie alle Parameter im Anfragetext mit Content-Type: application/x-www-form-urlencoded. Die Serveradresse bleibt in der URL.

Codebeispiele

Verifizierungscode senden

curl -X POST "https://{SERVER_ADDRESS}/GDPR_MSG/" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "Licence={LICENCE_CODE}" \ -d "Phone=33612345678" \ -d "Country=FRA" \ -d "Company=MYCOMPANY" \ -d "Custom_sms=Your confirmation code is"
fetch("https://{SERVER_ADDRESS}/GDPR_MSG/", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ Licence: "{LICENCE_CODE}", Phone: "33612345678", Country: "FRA", Company: "MYCOMPANY", Custom_sms: "Your confirmation code is" }) }) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.post( "https://{SERVER_ADDRESS}/GDPR_MSG/", data={ "Licence": "{LICENCE_CODE}", "Phone": "33612345678", "Country": "FRA", "Company": "MYCOMPANY", "Custom_sms": "Your confirmation code is", }, ) print(response.json())
<?php $ch = curl_init("https://{SERVER_ADDRESS}/GDPR_MSG/"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ 'Licence' => '{LICENCE_CODE}', 'Phone' => '33612345678', 'Country' => 'FRA', 'Company' => 'MYCOMPANY', 'Custom_sms' => 'Your confirmation code is', ])); 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_MSG/', qs.stringify({ Licence: '{LICENCE_CODE}', Phone: '33612345678', Country: 'FRA', Company: 'MYCOMPANY', Custom_sms: 'Your confirmation code is' })) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String form = "Licence={LICENCE_CODE}&Phone=33612345678&Country=FRA&Company=MYCOMPANY&Custom_sms=Your+confirmation+code+is"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{SERVER_ADDRESS}/GDPR_MSG/")) .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> { ["Licence"] = "{LICENCE_CODE}", ["Phone"] = "33612345678", ["Country"] = "FRA", ["Company"] = "MYCOMPANY", ["Custom_sms"] = "Your confirmation code is" }; var response = await client.PostAsync( "https://{SERVER_ADDRESS}/GDPR_MSG/", 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("Licence", "{LICENCE_CODE}") form.Set("Phone", "33612345678") form.Set("Country", "FRA") form.Set("Company", "MYCOMPANY") form.Set("Custom_sms", "Your confirmation code is") resp, err := http.PostForm("https://{SERVER_ADDRESS}/GDPR_MSG/", form) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) }

Parameter

Parameter Beschreibung Pflicht/Optional
Licence Ihrem Konto zugewiesener Lizenzcode. Pflicht
Phone Telefonnummer im internationalen Format, ohne das Pluszeichen + und ohne Leerzeichen (zum Beispiel 49XXXXXXXXXXX für Deutschland). Pflicht
Country ISO-3-Buchstaben-Ländercode. Pflicht
Company Firmenname, der als SMS-Absender verwendet wird. Mindestens 3 und maximal 11 Zeichen. Pflicht
Custom_sms Benutzerdefinierter SMS-Inhalt. Auf 125 Zeichen begrenzt. Der Verifizierungscode wird automatisch angehängt. Pflicht
Duration Gültigkeitsdauer des SMS-Codes in Minuten. Optional
Phonecom 1 oder 0. Gibt an, ob die Einwilligung zur telefonischen Kommunikation erteilt wurde. Optional
Email 1 oder 0. Gibt an, ob die Einwilligung zur E-Mail-Kommunikation erteilt wurde. Optional
Post 1 oder 0. Gibt an, ob die Einwilligung zur postalischen Kommunikation erteilt wurde. Optional
Sms 1 oder 0. Gibt an, ob die Einwilligung zur SMS-Kommunikation erteilt wurde. Optional
Hinweis – Die Parameter Phonecom, Email, Post und Sms sind jeweils optional, aber mindestens einer von ihnen muss auf 1 gesetzt werden — andernfalls schlägt die Anfrage mit dem Fehlercode 11 fehl.

Optionale Einwilligungsparameter für mehrere Kontakte: SMS2–SMS5, PHONE2–PHONE5, EMAIL2–EMAIL5, POST2–POST5 (Einwilligung für sekundäre Kontakte, gleiches 1/0-Format wie die primären Kanäle oben).

Antwort

Die JSON-Antwort enthält den SMS-Zustellstatus und Verifizierungsmetadaten.

Schlüssel Beschreibung Typ
status SMS-Zustellstatus. Siehe die Tabelle der Statuswerte unten. String
timeout Gültigkeitsdauer des Codes in Minuten. String
companyName Als Absender verwendeter Firmenname. String
country ISO-3-Buchstaben-Ländercode. String
to Telefonnummer des Empfängers im internationalen Format. String
channels Ausgewählte Kommunikationskanäle. Object
errors Fehlerdetails. Siehe die Tabelle der Fehlercodes unten. Object
smsToken Eindeutige Kennung der SMS. Übergeben Sie diesen Wert an GDPR_VERIF als Parameter Token. String
dateTime Datum und Uhrzeit des SMS-Versands. String

Statuswerte

Status Beschreibung
PENDING Die SMS wurde an den Betreiber gesendet.
DELIVERED Die SMS wurde erfolgreich zugestellt.
UNDELIVERABLE Die SMS konnte nicht zugestellt werden.
EXPIRED Die SMS ist vor der Zustellbestätigung abgelaufen.
REJECTED Die SMS wurde vom Betreiber abgelehnt.

Fehlercodes

Code Beschreibung
00 Keine Fehler.
01 Fehlende Parameter.
02 Dienst für diese Lizenz nicht autorisiert.
03 Ungültige Telefonnummer.
04 Ungültiger Ländercode.
05 Ungültige Dauer.
06 Land nicht gefunden.
07 Ungültiger Firmenname.
08 Interner API-Fehler.
09 Kein Zustellstatus empfangen.
10 Ungültige Einwilligungswerte.
11 Mindestens ein Kommunikationskanal muss aktiviert sein.

Antwortbeispiel

Erfolgreiche Zustellung
{ "channels": { "phone": 0, "post": 0, "sms": 1, "email": 1 }, "to": "33612345678", "errors": { "00": "00 - No errors" }, "status": "DELIVERED", "smsToken": "C6hfYZIER3CVoGVYwTiZLg", "timeout": "3", "companyName": "MYCOMPANY", "country": "FRA", "dateTime": "2019-07-29 11:32:32.876709" }

API testen

Klicken Sie auf die Schaltfläche unten, um diesen Endpunkt live in Ihrem Browser zu testen.

Konsole öffnen

Siehe auch

Verknüpfung mit

War dieser Beitrag hilfreich?

0 von 0 fanden dies hilfreich