API ID Mobile — Billing
Utilisez cet endpoint pour récupérer une facture ou un justificatif de domicile auprès de l'opérateur, avec le consentement de l'utilisateur. Le processus comporte deux étapes : initier la demande de consentement, puis récupérer le document.
Flux en deux étapes - Appelez d'abord /IDMOBILE/ pour demander le consentement de l'utilisateur et obtenir l'URL de la page de consentement de l'opérateur. Une fois le consentement donné, appelez /GET/ pour récupérer le document de facturation.
Documentation ID Mobile associée :
⬇ Download OpenAPI 3.0.0 spec (JSON)
Étape 1 sur 2 — Demander le consentement
Initiez la demande de consentement et obtenez l'URL de la page de consentement de l'opérateur.
Étape 1 — Initier la demande de consentement
Requête
GET et POST sont toutes deux prises en charge.
{SERVER_ADDRESS} et {LICENCE_CODE} sont fournis par DQE à la création de votre compte. Contactez votre chargé de compte DQE pour obtenir ces identifiants.
GET POST
GET https://{SERVER_ADDRESS}/IDMOBILE/?number ={NUM}&token ={TOKEN}&mode ={MODE}&name ={NAME}&code_name ={CODE_NAME}&licence ={LICENCE_CODE}&scope =billing&redirect_uri ={URL_REDIRECT}
Exemples de code
Demander le consentement pour récupérer le document de facturation
cURL JavaScript Python PHP Node.js Java C# Go
curl "https://{SERVER_ADDRESS}/IDMOBILE/?number={NUM}&token={TOKEN}&mode={MODE}&name={NAME}&code_name={CODE_NAME}&licence={LICENCE_CODE}&scope=billing&redirect_uri={URL_REDIRECT}"
fetch("https://{SERVER_ADDRESS}/IDMOBILE/?" + new URLSearchParams({
number: "{NUM}",
token: "{TOKEN}",
mode: "{MODE}",
name: "{NAME}",
code_name: "{CODE_NAME}",
licence: "{LICENCE_CODE}",
scope: "billing",
redirect_uri: "{URL_REDIRECT}"
}))
.then(r => r.json())
.then(data => console.log(data));
import requests
response = requests.get(
"https://{SERVER_ADDRESS}/IDMOBILE/",
params={
"number": "{NUM}",
"token": "{TOKEN}",
"mode": "{MODE}",
"name": "{NAME}",
"code_name": "{CODE_NAME}",
"licence": "{LICENCE_CODE}",
"scope": "billing",
"redirect_uri": "{URL_REDIRECT}",
},
)
print(response.json())
<?php
$params = http_build_query([
'number' => '{NUM}',
'token' => '{TOKEN}',
'mode' => '{MODE}',
'name' => '{NAME}',
'code_name' => '{CODE_NAME}',
'licence' => '{LICENCE_CODE}',
'scope' => 'billing',
'redirect_uri' => '{URL_REDIRECT}',
]);
$ch = curl_init("https://{SERVER_ADDRESS}/IDMOBILE/?{$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}/IDMOBILE/', {
params: {
number: '{NUM}',
token: '{TOKEN}',
mode: '{MODE}',
name: '{NAME}',
code_name: '{CODE_NAME}',
licence: '{LICENCE_CODE}',
scope: 'billing',
redirect_uri: '{URL_REDIRECT}'
}
})
.then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient();
String url = "https://{SERVER_ADDRESS}/IDMOBILE/"
+ "?number={NUM}&token={TOKEN}&mode={MODE}&name={NAME}&code_name={CODE_NAME}&licence={LICENCE_CODE}&scope=billing&redirect_uri={URL_REDIRECT}";
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}/IDMOBILE/" +
"?number={NUM}&token={TOKEN}&mode={MODE}&name={NAME}&code_name={CODE_NAME}&licence={LICENCE_CODE}&scope=billing&redirect_uri={URL_REDIRECT}";
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}/IDMOBILE/" +
"?number={NUM}&token={TOKEN}&mode={MODE}&name={NAME}&code_name={CODE_NAME}&licence={LICENCE_CODE}&scope=billing&redirect_uri={URL_REDIRECT}"
resp, err := http.Get(url)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
POST https://{SERVER_ADDRESS}/IDMOBILE/
Ajoutez les paramètres suivants dans le corps de la requête au format x-www-form-urlencoded.
Exemples de code
Demander le consentement pour récupérer le document de facturation
cURL JavaScript Python PHP Node.js Java C# Go
curl -X POST "https://{SERVER_ADDRESS}/IDMOBILE/" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "licence={LICENCE_CODE}" \
-d "number={NUM}" \
-d "token={TOKEN}" \
-d "mode={MODE}" \
-d "name={NAME}" \
-d "code_name={CODE_NAME}" \
-d "scope=billing" \
-d "redirect_uri={URL_REDIRECT}"
fetch("https://{SERVER_ADDRESS}/IDMOBILE/", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
licence: "{LICENCE_CODE}",
number: "{NUM}",
token: "{TOKEN}",
mode: "{MODE}",
name: "{NAME}",
code_name: "{CODE_NAME}",
scope: "billing",
redirect_uri: "{URL_REDIRECT}"
})
})
.then(r => r.json())
.then(data => console.log(data));
import requests
response = requests.post(
"https://{SERVER_ADDRESS}/IDMOBILE/",
data={
"licence": "{LICENCE_CODE}",
"number": "{NUM}",
"token": "{TOKEN}",
"mode": "{MODE}",
"name": "{NAME}",
"code_name": "{CODE_NAME}",
"scope": "billing",
"redirect_uri": "{URL_REDIRECT}",
},
)
print(response.json())
<?php
$ch = curl_init("https://{SERVER_ADDRESS}/IDMOBILE/");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'licence' => '{LICENCE_CODE}',
'number' => '{NUM}',
'token' => '{TOKEN}',
'mode' => '{MODE}',
'name' => '{NAME}',
'code_name' => '{CODE_NAME}',
'scope' => 'billing',
'redirect_uri' => '{URL_REDIRECT}',
]));
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}/IDMOBILE/', qs.stringify({
licence: '{LICENCE_CODE}',
number: '{NUM}',
token: '{TOKEN}',
mode: '{MODE}',
name: '{NAME}',
code_name: '{CODE_NAME}',
scope: 'billing',
redirect_uri: '{URL_REDIRECT}'
}))
.then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient();
String form = "licence={LICENCE_CODE}&number={NUM}&token={TOKEN}&mode={MODE}&name={NAME}&code_name={CODE_NAME}&scope=billing&redirect_uri={URL_REDIRECT}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://{SERVER_ADDRESS}/IDMOBILE/"))
.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}",
["number"] = "{NUM}",
["token"] = "{TOKEN}",
["mode"] = "{MODE}",
["name"] = "{NAME}",
["code_name"] = "{CODE_NAME}",
["scope"] = "billing",
["redirect_uri"] = "{URL_REDIRECT}"
};
var response = await client.PostAsync(
"https://{SERVER_ADDRESS}/IDMOBILE/",
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("number", "{NUM}")
form.Set("token", "{TOKEN}")
form.Set("mode", "{MODE}")
form.Set("name", "{NAME}")
form.Set("code_name", "{CODE_NAME}")
form.Set("scope", "billing")
form.Set("redirect_uri", "{URL_REDIRECT}")
resp, err := http.PostForm("https://{SERVER_ADDRESS}/IDMOBILE/", form)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
Paramètres
Paramètre
Description
Obl / Opt
SERVER_ADDRESS
Adresse du serveur DQE qui traitera les données.
Obligatoire
licence
Numéro qui vous est attribué comme code de licence.
Obligatoire
number
Numéro de téléphone.
Obligatoire
token
Jeton obtenu via l'authentification.
Obligatoire
mode
2 : authentification par code.Fixed value: 2
Obligatoire
name
Nom du partenaire dans la base de données DQE Software, généralement le nom de votre entreprise.
Obligatoire
code_name
Champ optionnel contenant un code associé à name.
Optionnel
scope
Static value. Must be billing for this scope.Fixed value: billing
Obligatoire
redirect_uri
URL de redirection. DQE ajoute le jeton de session et le statut à la redirection.
Optionnel
Combinaison de scopes — billing peut être combiné avec formfilling (tous deux basés sur le consentement) dans une même requête, par exemple scope=billing,formfilling, et avec info (intelligence sur le numéro de téléphone) dans n'importe quelle combinaison, par exemple scope=billing,info. Voir les champs info ci-dessous. Contactez votre chargé de compte DQE pour la forme complète de la réponse combinée billing+formfilling.
Champs additionnels info — renvoyés en plus des champs propres à cet endpoint lorsque info est inclus dans scope :
Champ
Description
Exemple
telorigine
Numéro de téléphone de la requête.
0600000000
tel
Numéro de téléphone, formaté.
+33600000000
geolocation
Situation géographique du numéro de téléphone.
FRANCE
operator
Opérateur actuel du numéro de téléphone, si souscrit.
ORANGE
oldoperator
Opérateur précédent du numéro de téléphone.
SFR
ported
Indique si le numéro de téléphone a été porté, si souscrit.
Y
type
Type du numéro de téléphone.
MOBILE
iderror
Code d'erreur de la vérification (0 ou 1).
1
Réponse
Si la requête aboutit, l'API retourne un objet JSON contenant les clés suivantes.
Clé
Description
Type
status
success : les informations ont été récupérées avec succès.
STRING
scope
billing
STRING
billing
Justificatif de domicile encodé en Base64.
STRING
En attente
Clé
Description
Type
status
pending : DQE attend la réponse de l'opérateur.
STRING
scope
billing
STRING
Exemple de réponse
Demande de consentement réussie {
"status" : "success" ,
"scope" : "billing" ,
"billing" : "N0YXJ0eHJlZgo0OTg2MQolJUVPRgoKLS1ZS0xJNTYpPUlSeFdNUzEoYXJpOWI/UklzLkRXZ1dwUF9FLS0K"
}
Pending — waiting for the operator {
"status" : "pending" ,
"scope" : "billing"
}
Erreurs
ID d'erreur
Type d'erreur
Description
01
invalid request
La requête n'est pas valide.
02
invalid licence key
La licence n'est pas valide.
04
invalid scope
Scope invalide.
05
missing or empty parameter (user_infos) for this scope
Un paramètre est manquant pour le scope demandé.
06
bad parameter format (user_infos) is not a valid JSON
Le paramètre user_infos n'est pas un JSON valide.
07
missing mandatory key in user informations (phone)
La clé phone est obligatoire dans le paramètre user_infos pour cet opérateur.
09
ineligible phone number
Le numéro de téléphone n'est pas éligible pour la solution.
10
invalid phone number
Le numéro de téléphone n'existe pas.
11
phone number is empty
Le numéro de téléphone est vide.
12
phone check failed
La vérification auprès de l'opérateur a échoué.
13
operator [Operator Name] not found
L'opérateur n'a pas pu être trouvé.
14
operator [Operator Name] not authorized for this licence
Votre licence n'est pas autorisée pour cet opérateur.
15
operator [Operator Name] not supported yet
La solution n'est pas encore disponible pour cet opérateur.
16
operator [Operator Name] unreachable
L'opérateur n'a pas pu être contacté.
17
scope not supported by this operator [Operator Name] yet
Ce scope n'est pas pris en charge par l'opérateur.
30
invalid or expired token
Le jeton a expiré.
Tester l'API
Cliquez sur le bouton ci-dessous pour tester cet endpoint en direct dans votre navigateur.
Ouvrir la console
Étape 2 sur 2 — Récupérer le document de facturation
Une fois que l'utilisateur a donné son consentement, récupérez le document de facturation retourné par l'opérateur.
Étape 2 — Récupérer le document de facturation
Requête
GET et POST sont toutes deux prises en charge.
{SERVER_ADDRESS} et {LICENCE_CODE} sont fournis par DQE à la création de votre compte. Contactez votre chargé de compte DQE pour obtenir ces identifiants.
GET POST
GET https://{SERVER_ADDRESS}/GET/?token ={TOKEN}&Licence ={LICENCE_CODE}&scope =billing
Exemples de code
Récupérer le document de facturation une fois le consentement obtenu
cURL JavaScript Python PHP Node.js Java C# Go
curl "https://{SERVER_ADDRESS}/GET/?token={TOKEN}&Licence={LICENCE_CODE}&scope=billing"
fetch("https://{SERVER_ADDRESS}/GET/?" + new URLSearchParams({
token: "{TOKEN}",
Licence: "{LICENCE_CODE}",
scope: "billing"
}))
.then(r => r.json())
.then(data => console.log(data));
import requests
response = requests.get(
"https://{SERVER_ADDRESS}/GET/",
params={
"token": "{TOKEN}",
"Licence": "{LICENCE_CODE}",
"scope": "billing",
},
)
print(response.json())
<?php
$params = http_build_query([
'token' => '{TOKEN}',
'Licence' => '{LICENCE_CODE}',
'scope' => 'billing',
]);
$ch = curl_init("https://{SERVER_ADDRESS}/GET/?{$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}/GET/', {
params: {
token: '{TOKEN}',
Licence: '{LICENCE_CODE}',
scope: 'billing'
}
})
.then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient();
String url = "https://{SERVER_ADDRESS}/GET/"
+ "?token={TOKEN}&Licence={LICENCE_CODE}&scope=billing";
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}/GET/" +
"?token={TOKEN}&Licence={LICENCE_CODE}&scope=billing";
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}/GET/" +
"?token={TOKEN}&Licence={LICENCE_CODE}&scope=billing"
resp, err := http.Get(url)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
POST https://{SERVER_ADDRESS}/GET/
Ajoutez les paramètres suivants dans le corps de la requête au format x-www-form-urlencoded.
Exemples de code
Récupérer le document de facturation une fois le consentement obtenu
cURL JavaScript Python PHP Node.js Java C# Go
curl -X POST "https://{SERVER_ADDRESS}/GET/" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "Licence={LICENCE_CODE}" \
-d "token={TOKEN}" \
-d "scope=billing"
fetch("https://{SERVER_ADDRESS}/GET/", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
Licence: "{LICENCE_CODE}",
token: "{TOKEN}",
scope: "billing"
})
})
.then(r => r.json())
.then(data => console.log(data));
import requests
response = requests.post(
"https://{SERVER_ADDRESS}/GET/",
data={
"Licence": "{LICENCE_CODE}",
"token": "{TOKEN}",
"scope": "billing",
},
)
print(response.json())
<?php
$ch = curl_init("https://{SERVER_ADDRESS}/GET/");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'Licence' => '{LICENCE_CODE}',
'token' => '{TOKEN}',
'scope' => 'billing',
]));
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}/GET/', qs.stringify({
Licence: '{LICENCE_CODE}',
token: '{TOKEN}',
scope: 'billing'
}))
.then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient();
String form = "Licence={LICENCE_CODE}&token={TOKEN}&scope=billing";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://{SERVER_ADDRESS}/GET/"))
.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}",
["token"] = "{TOKEN}",
["scope"] = "billing"
};
var response = await client.PostAsync(
"https://{SERVER_ADDRESS}/GET/",
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("token", "{TOKEN}")
form.Set("scope", "billing")
resp, err := http.PostForm("https://{SERVER_ADDRESS}/GET/", form)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
Paramètres
Paramètre
Description
Obl / Opt
SERVER_ADDRESS
Adresse du serveur DQE qui traitera les données.
Obligatoire
Licence
Numéro qui vous est attribué comme code de licence.
Obligatoire
token
Jeton obtenu via l'authentification.
Obligatoire
scope
Static value. Must be billing for this scope.Fixed value: billing
Obligatoire
Réponse
L'API retourne un objet JSON contenant les clés suivantes :
Clé
Description
Type
status
success : le document a été récupéré avec succès.
STRING
scope
billing
STRING
billing
Justificatif de domicile encodé en Base64.
STRING
En attente
Clé
Description
Type
status
pending : DQE attend la réponse de l'opérateur.
STRING
scope
billing
STRING
Exemple de réponse
Récupération réussie {
"status" : "success" ,
"scope" : "billing" ,
"billing" : "N0YXJ0eHJlZgo0OTg2MQolJUVPRgoKLS1ZS0xJNTYpPUlSeFdNUzEoYXJpOWI/UklzLkRXZ1dwUF9FLS0K"
}
Error {
"status" : "error" ,
"error_type" : "internal server error" ,
"error_id" : "99"
}
Erreurs
ID d'erreur
Type d'erreur
Description
01
invalid request
La requête n'est pas valide.
02
invalid licence key
La licence n'est pas valide.
04
invalid scope
Scope invalide.
18
failed to retrieve data from operator
Aucune donnée n'a été reçue après la validation de l'OTP.
20
OTP incorrect
La validation de l'OTP n'a pas été terminée.
21
access denied
La validation de l'OTP a été refusée.
30
invalid or expired token
Le jeton a expiré.
99
internal server error
Erreur serveur.
Tester l'API
Cliquez sur le bouton ci-dessous pour tester cet endpoint en direct dans votre navigateur.
Ouvrir la console