Envoyer un code OTP
curl --request POST \
--url https://api.notiline.net/v1/otp/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "SMS",
"sender": "NOTILINE",
"to": "+2250709538217",
"message": "Bonjour, votre code de vérification est ##OTP##",
"otp_type": "numeric",
"otp_length": 4,
"otp_expiry": 300,
"use_local_number": false,
"application_name": "Mon application",
"language": "fr"
}
'import requests
url = "https://api.notiline.net/v1/otp/send"
payload = {
"channel": "SMS",
"sender": "NOTILINE",
"to": "+2250709538217",
"message": "Bonjour, votre code de vérification est ##OTP##",
"otp_type": "numeric",
"otp_length": 4,
"otp_expiry": 300,
"use_local_number": False,
"application_name": "Mon application",
"language": "fr"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: 'SMS',
sender: 'NOTILINE',
to: '+2250709538217',
message: 'Bonjour, votre code de vérification est ##OTP##',
otp_type: 'numeric',
otp_length: 4,
otp_expiry: 300,
use_local_number: false,
application_name: 'Mon application',
language: 'fr'
})
};
fetch('https://api.notiline.net/v1/otp/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.notiline.net/v1/otp/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel' => 'SMS',
'sender' => 'NOTILINE',
'to' => '+2250709538217',
'message' => 'Bonjour, votre code de vérification est ##OTP##',
'otp_type' => 'numeric',
'otp_length' => 4,
'otp_expiry' => 300,
'use_local_number' => false,
'application_name' => 'Mon application',
'language' => 'fr'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notiline.net/v1/otp/send"
payload := strings.NewReader("{\n \"channel\": \"SMS\",\n \"sender\": \"NOTILINE\",\n \"to\": \"+2250709538217\",\n \"message\": \"Bonjour, votre code de vérification est ##OTP##\",\n \"otp_type\": \"numeric\",\n \"otp_length\": 4,\n \"otp_expiry\": 300,\n \"use_local_number\": false,\n \"application_name\": \"Mon application\",\n \"language\": \"fr\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.notiline.net/v1/otp/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"SMS\",\n \"sender\": \"NOTILINE\",\n \"to\": \"+2250709538217\",\n \"message\": \"Bonjour, votre code de vérification est ##OTP##\",\n \"otp_type\": \"numeric\",\n \"otp_length\": 4,\n \"otp_expiry\": 300,\n \"use_local_number\": false,\n \"application_name\": \"Mon application\",\n \"language\": \"fr\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notiline.net/v1/otp/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel\": \"SMS\",\n \"sender\": \"NOTILINE\",\n \"to\": \"+2250709538217\",\n \"message\": \"Bonjour, votre code de vérification est ##OTP##\",\n \"otp_type\": \"numeric\",\n \"otp_length\": 4,\n \"otp_expiry\": 300,\n \"use_local_number\": false,\n \"application_name\": \"Mon application\",\n \"language\": \"fr\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "succès",
"data": {
"uniq_id": "A1B2C3D4E5F6",
"code": "1234",
"expires_at": 1643723400
}
}{
"status": 400,
"message": "erreur_de_validation",
"errors": [
"Le champ to doit être une adresse e-mail valide."
]
}{
"status": 401,
"message": "Non autorisé"
}{
"status": 402,
"message": "solde_insuffisant",
"data": {
"costs": 0.5,
"balance": 0
}
}{
"status": 500,
"message": "erreur_application"
}Otp
Envoyer un code OTP
Envoie un code OTP via SMS ou email
POST
/
otp
/
send
Envoyer un code OTP
curl --request POST \
--url https://api.notiline.net/v1/otp/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "SMS",
"sender": "NOTILINE",
"to": "+2250709538217",
"message": "Bonjour, votre code de vérification est ##OTP##",
"otp_type": "numeric",
"otp_length": 4,
"otp_expiry": 300,
"use_local_number": false,
"application_name": "Mon application",
"language": "fr"
}
'import requests
url = "https://api.notiline.net/v1/otp/send"
payload = {
"channel": "SMS",
"sender": "NOTILINE",
"to": "+2250709538217",
"message": "Bonjour, votre code de vérification est ##OTP##",
"otp_type": "numeric",
"otp_length": 4,
"otp_expiry": 300,
"use_local_number": False,
"application_name": "Mon application",
"language": "fr"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: 'SMS',
sender: 'NOTILINE',
to: '+2250709538217',
message: 'Bonjour, votre code de vérification est ##OTP##',
otp_type: 'numeric',
otp_length: 4,
otp_expiry: 300,
use_local_number: false,
application_name: 'Mon application',
language: 'fr'
})
};
fetch('https://api.notiline.net/v1/otp/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.notiline.net/v1/otp/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel' => 'SMS',
'sender' => 'NOTILINE',
'to' => '+2250709538217',
'message' => 'Bonjour, votre code de vérification est ##OTP##',
'otp_type' => 'numeric',
'otp_length' => 4,
'otp_expiry' => 300,
'use_local_number' => false,
'application_name' => 'Mon application',
'language' => 'fr'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notiline.net/v1/otp/send"
payload := strings.NewReader("{\n \"channel\": \"SMS\",\n \"sender\": \"NOTILINE\",\n \"to\": \"+2250709538217\",\n \"message\": \"Bonjour, votre code de vérification est ##OTP##\",\n \"otp_type\": \"numeric\",\n \"otp_length\": 4,\n \"otp_expiry\": 300,\n \"use_local_number\": false,\n \"application_name\": \"Mon application\",\n \"language\": \"fr\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.notiline.net/v1/otp/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"SMS\",\n \"sender\": \"NOTILINE\",\n \"to\": \"+2250709538217\",\n \"message\": \"Bonjour, votre code de vérification est ##OTP##\",\n \"otp_type\": \"numeric\",\n \"otp_length\": 4,\n \"otp_expiry\": 300,\n \"use_local_number\": false,\n \"application_name\": \"Mon application\",\n \"language\": \"fr\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notiline.net/v1/otp/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel\": \"SMS\",\n \"sender\": \"NOTILINE\",\n \"to\": \"+2250709538217\",\n \"message\": \"Bonjour, votre code de vérification est ##OTP##\",\n \"otp_type\": \"numeric\",\n \"otp_length\": 4,\n \"otp_expiry\": 300,\n \"use_local_number\": false,\n \"application_name\": \"Mon application\",\n \"language\": \"fr\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "succès",
"data": {
"uniq_id": "A1B2C3D4E5F6",
"code": "1234",
"expires_at": 1643723400
}
}{
"status": 400,
"message": "erreur_de_validation",
"errors": [
"Le champ to doit être une adresse e-mail valide."
]
}{
"status": 401,
"message": "Non autorisé"
}{
"status": 402,
"message": "solde_insuffisant",
"data": {
"costs": 0.5,
"balance": 0
}
}{
"status": 500,
"message": "erreur_application"
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
application/json
Canal d'envoi (SMS ou EMAIL)
Options disponibles:
SMS, EMAIL Exemple:
"SMS"
Nom de l'expéditeur
Exemple:
"NOTILINE"
Destinataire
Exemple:
"+2250709538217"
Message
Exemple:
"Bonjour, votre code de vérification est ##OTP##"
Type de code OTP (numérique ou alphanumérique)
Options disponibles:
numeric, alphanumeric Exemple:
"numeric"
Longueur du code OTP
Plage requise:
4 <= x <= 6Exemple:
4
Durée de vie du code OTP
Plage requise:
60 <= x <= 3600Exemple:
300
Utiliser un numéro local
Exemple:
false
Nom de l'application
Exemple:
"Mon application"
Langue du message
Options disponibles:
fr, en, es, pt Exemple:
"fr"
⌘I