Guide d'utilisation de l'API
- Les tokens JWT sont utilisés pour configurer et administrer le compte.
- Les tokens API sont utilisés pour accéder aux enregistrements, seuls ces derniers sont à utiliser dans votre ERP.
Création du compte
- Utilisez POST/auth/register pour créer votre compte
curl -H "Content-Type: application/json" --data-raw '{"user":"user@domain.com","password":"secretPassword"}' https://rec.over.ovh/auth/register | jqfetch("https://rec.over.ovh/auth/register", {
method: "POST",
headers: {"accept":"application/json"},
body: '{"user":"user@domain.com","password":"secretPassword"}'
}); - Activez votre compte avec l'E-mail que vous avez reçu.
Générez vos tokens
- Récupérez un access token JWT avec POST/auth/login
curl -H "Content-Type: application/json" --data-raw '{"user":"user@domain.com","password":"secretPassword"}' https://rec.over.ovh/auth/login | jqfetch("https://rec.over.ovh/auth/login", {
method: "POST",
headers: {"accept":"application/json"},
body: '{"user":"user@domain.com","password":"secretPassword"}'
});{"accessToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"}Sauvgardez le token dans la variable JWT_ACCESS_TOKEN - Utilisez votre access-token JWT POST/ovh/add pour rattacher votre compte OVH
curl -X POST -H "Authorization: Bearer $JWT_ACCESS_TOKEN" https://rec.over.ovh/ovh/add | jqfetch("https://rec.over.ovh/ovh/add", {
method: "POST",
headers: {"accept":"application/json","Authorization":"Bearer JWT_ACCESS_TOKEN"},
});{"goto":"https://eu.api.ovh.com/auth/?credentialToken=abcdefgklmnop123456789"}REDIRECT_DONE https://rec.over.ovh/ovh/check/abcdeghijklmnopqrstuvwzy - Vous pouvez utiliser votre JWT access-token POST/account/blocklist pour cacher certains enregistrements et les rendre inaccessibles via l'API
curl -H "Content-Type: application/json" --data-raw '{"number":"0033123456789"}' -H "Authorization: Bearer $JWT_ACCESS_TOKEN" https://rec.over.ovh/account/blocklist | jqfetch("https://rec.over.ovh/account/blocklist", {
method: "POST",
headers: {"accept":"application/json","Authorization":"Bearer JWT_ACCESS_TOKEN"},
body: '{"number":"0033123456789"}'
});["0033123456789"] - Utilisez votre access-token JWT pour créer un token API, il vous premettra de recupérer les enregistrements POST/account/apitoken
curl -H "Content-Type: application/json" --data-raw '{"comment":"dev key","ttl":36000}' -H "Authorization: Bearer $JWT_ACCESS_TOKEN" https://rec.over.ovh/account/apitoken | jqfetch("https://rec.over.ovh/account/apitoken", {
method: "POST",
headers: {"accept":"application/json","Authorization":"Bearer JWT_ACCESS_TOKEN"},
body: '{"comment":"dev key","ttl":36000}'
});{"value":"1234567890abcdeghijklmnopqrstuvwzyZ","comment":"dev key","expireAt":"2021-06-29T21:46:32.006Z"}A present sauvegardons le token dans API_TOKEN
Recherche de conversation téléphonique
toutes les recherche ce font avec le point d'entrée GET/records
- Example lister toutes les conversation impliquant les numéros de telephone +33112233 ou +33112233
curl -H "Authorization: Bearer $API_TOKEN" https://rec.over.ovh/records?number=0033112233&number=0033112233 | jqfetch("https://rec.over.ovh/records?number=0033112233&number=0033112233", {
method: "GET",
headers: {"accept":"application/json","Authorization":"Bearer API_TOKEN"},
}); - Example lister toutes les conversation n'impliquant les numéros de telephone +33112233 ou +33112233
curl -H "Authorization: Bearer $API_TOKEN" https://rec.over.ovh/records?number=0033112233&number=0033112233¬=1 | jqfetch("https://rec.over.ovh/records?number=0033112233&number=0033112233¬=1", {
method: "GET",
headers: {"accept":"application/json","Authorization":"Bearer API_TOKEN"},
}); - Example lister toutes les toutes les conversation ayant durée plus de 10 minutes
curl -H "Authorization: Bearer $API_TOKEN" https://rec.over.ovh/records?durationmin=600 | jqfetch("https://rec.over.ovh/records?durationmin=600", {
method: "GET",
headers: {"accept":"application/json","Authorization":"Bearer API_TOKEN"},
}); - Example lister toutes les toutes les conversation entrante ayant durée plus de 10 minutes
curl -H "Authorization: Bearer $API_TOKEN" https://rec.over.ovh/records?durationmin=600&direction=IN | jqfetch("https://rec.over.ovh/records?durationmin=600&direction=IN", {
method: "GET",
headers: {"accept":"application/json","Authorization":"Bearer API_TOKEN"},
});