Fraud Prevention API
The Fraud Prevention API is a set of APIs supporting Fraud detection including managing own fraud rules. For more details, please visit the Vonage Developer Center.
Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
Demande de renseignements Paramètres
100Page size in Integer format
1Page number in Integer format
Threshold value in Integer format
Interval value in Integer format it will be presented in minutes
Array of ISO countries codes
11005450GB6010SMSabcdef01-2345-6789-abcd-ef0123456789https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779self link
https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS?page=1&size=100first link of the paginated result set
https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS?page=4&size=100last link of the paginated result set
https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS?page=1&size=100previous link of the paginated result set
https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS?page=1&size=100self link
Exemple Réponse
{
"page": 1,
"page_size": 100,
"total_pages": 5,
"total_items": 450,
"_embedded": {
"entries": [
{
"country": "GB",
"interval": 60,
"threshold": 10,
"product": "SMS",
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"_links": {
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
}
}
}
]
},
"_links": {
"first": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS?page=1&size=100"
},
"last": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS?page=4&size=100"
},
"prev": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS?page=1&size=100"
},
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS?page=1&size=100"
}
}
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
SMSProduct type (SMS or VOICE)
VOICESMSGBISO country code
6010Exemple Demande
{
"product": "SMS",
"country": "GB",
"interval": 60,
"threshold": 10
}{
"product": "SMS",
"country": "GB",
"interval": 60,
"threshold": 10
}GB6010SMSabcdef01-2345-6789-abcd-ef0123456789https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779self link
Exemple Réponse
{
"country": "GB",
"interval": 60,
"threshold": 10,
"product": "SMS",
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"_links": {
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
}
}
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
SMSProduct type (SMS or VOICE)
VOICESMSGBISO country code
6010Exemple Demande
{
"product": "SMS",
"country": "GB",
"interval": 60,
"threshold": 10
}{
"product": "SMS",
"country": "GB",
"interval": 60,
"threshold": 10
}GB6010SMSabcdef01-2345-6789-abcd-ef0123456789https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779self link
Exemple Réponse
{
"country": "GB",
"interval": 60,
"threshold": 10,
"product": "SMS",
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"_links": {
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
}
}
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
GB6010SMSabcdef01-2345-6789-abcd-ef0123456789https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779self link
Exemple Réponse
{
"country": "GB",
"interval": 60,
"threshold": 10,
"product": "SMS",
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"_links": {
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
}
}
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
Opérations disponibles
Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
trueused to turn on/off AIT protection
standardRequired if protection_enabled is set to true. Default AIT protection level will be used for countries where no specific per-country configuration exists.
highstandardnonearray of specific per-country AIT protection level configurations
UScountry code in ISO 3166-1 Alpha-2 standard
highAIT protection level
highstandardnonehttps://api.nexmo.com/v0.1/fraud-defender/configurations/protections/ait/SMSExemple Réponse
{
"data": {
"protection_enabled": true,
"default_protection_level": "standard",
"protection_level_per_country": [
{
"country": "US",
"protection_level": "standard"
}
],
"_links": {
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/configurations/protections/ait/SMS"
}
}
}
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
trueused to turn on/off AIT protection
standardRequired if protection_enabled is set to true. Default AIT protection level will be used for countries where no specific per-country configuration exists.
highstandardnonearray of specific per-country AIT protection level configurations
UScountry code in ISO 3166-1 Alpha-2 standard
highAIT protection level
highstandardnoneExemple Demande
{
"data": {
"protection_enabled": true,
"default_protection_level": "standard",
"protection_level_per_country": [
{
"country": "US",
"protection_level": "high"
}
]
}
}{
"data": {
"protection_enabled": true,
"default_protection_level": "standard",
"protection_level_per_country": [
{
"country": "US",
"protection_level": "high"
}
]
}
}trueused to turn on/off AIT protection
standardRequired if protection_enabled is set to true. Default AIT protection level will be used for countries where no specific per-country configuration exists.
highstandardnonearray of specific per-country AIT protection level configurations
UScountry code in ISO 3166-1 Alpha-2 standard
highAIT protection level
highstandardnonehttps://api.nexmo.com/v0.1/fraud-defender/configurations/protections/ait/SMSExemple Réponse
{
"data": {
"protection_enabled": true,
"default_protection_level": "standard",
"protection_level_per_country": [
{
"country": "US",
"protection_level": "standard"
}
],
"_links": {
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/configurations/protections/ait/SMS"
}
}
}
}Opérations disponibles
Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
smsvoicesms1544The prefix attribute is used to check whether a phone number begins with a particular sequence of digits. It's not related to phone number prefixes.
My custom prefix ruleHuman readable reason
blockblockallowactiveactivearchivedExemple Demande
{
"product": "sms",
"prefix": "44",
"reason": "My custom prefix rule",
"action": "block",
"status": "active"
}{
"product": "sms",
"prefix": "44",
"reason": "My custom prefix rule",
"action": "block",
"status": "active"
}test-idsmsvoicesms44The prefix attribute is used to check whether a phone number begins with a particular sequence of digits. It's not related to phone number prefixes.
fromfromtooutboundoutboundOutbound rules apply to traffic generated from you API Key. Inbound rules apply to traffic sent to your phone numbers.
blockblockallowMy custom prefix ruleHuman readable reason
editvieweditactiveactivearchived2022-12-09T18:19:262022-11-09T18:19:262022-10-09T18:19:26https://api.nexmo.com/v0.1/fraud-defender/rules/test-idExemple Réponse
{
"id": "test-id",
"product": "sms",
"prefix": "44",
"direction": "from",
"traffic_direction": "outbound",
"action": "block",
"reason": "My custom prefix rule",
"permission": "edit",
"status": "active",
"created_timestamp": "2022-12-09T18:19:26",
"updated_timestamp": "2022-11-09T18:19:26",
"archived_timestamp": "2022-10-09T18:19:26",
"_links": {
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/rules/test-id"
}
}
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
Demande de renseignements Paramètres
if passed, lists rules for that product. if not, gives such for all product types
voicesmsphone prefix filter
reason filter
action filter
rule type filter (allow, block)
filter rules by status (active, archived, all)
truedefines whether to display default rules or not
trueshow custom rules flag
150page size parameter, starts from 1
1page offset parameter, starts from 1
sort by product, prefix or traffic and it's case-insensitive
productprefixtrafficdescsort order either asc or desc and it's case-insensitive
ascdeschttps://api.nexmo.com/v0.1/fraud-defender/rules?order=asc&page=1&page_size=3first link of the paginated result set
https://api.nexmo.com/v0.1/fraud-defender/rules?order=asc&page=4&page_size=3last link of the paginated result set
https://api.nexmo.com/v0.1/fraud-defender/rules?order=asc&page=3&page_size=3next link of the paginated result set
https://api.nexmo.com/v0.1/fraud-defender/rules?order=asc&page=1&page_size=3previous link of the paginated result set
https://api.nexmo.com/v0.1/fraud-defender/rules?order=asc&page=2&page_size=3self link
2Page number
3Page size number or 0 if no entries found. Default is 150.
11Total entries for the result set or 0 if no entries found
4Total pages for the paginated result set or 1 if no entries found
test-idsmsvoicesms44The prefix attribute is used to check whether a phone number begins with a particular sequence of digits. It's not related to phone number prefixes.
fromfromtooutboundoutboundOutbound rules apply to traffic generated from you API Key. Inbound rules apply to traffic sent to your phone numbers.
blockblockallowMy custom prefix ruleHuman readable reason
editvieweditactiveactivearchived2022-12-09T18:19:262022-11-09T18:19:262022-10-09T18:19:26https://api.nexmo.com/v0.1/fraud-defender/rules/test-idExemple Réponse
{
"_links": {
"first": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/rules?order=asc&page=1&page_size=3"
},
"last": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/rules?order=asc&page=4&page_size=3"
},
"next": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/rules?order=asc&page=3&page_size=3"
},
"prev": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/rules?order=asc&page=1&page_size=3"
},
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/rules?order=asc&page=2&page_size=3"
}
},
"page": {
"number": 2,
"size": 3,
"totalElements": 11,
"totalPages": 4
},
"_embedded": {
"rules": [
{
"id": "test-id",
"product": "sms",
"prefix": "44",
"direction": "from",
"traffic_direction": "outbound",
"action": "block",
"reason": "My custom prefix rule",
"permission": "edit",
"status": "active",
"created_timestamp": "2022-12-09T18:19:26",
"updated_timestamp": "2022-11-09T18:19:26",
"archived_timestamp": "2022-10-09T18:19:26",
"_links": {
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/rules/test-id"
}
}
}
]
}
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
test-idsmsvoicesms44The prefix attribute is used to check whether a phone number begins with a particular sequence of digits. It's not related to phone number prefixes.
fromfromtooutboundoutboundOutbound rules apply to traffic generated from you API Key. Inbound rules apply to traffic sent to your phone numbers.
blockblockallowMy custom prefix ruleHuman readable reason
editvieweditactiveactivearchived2022-12-09T18:19:262022-11-09T18:19:262022-10-09T18:19:26https://api.nexmo.com/v0.1/fraud-defender/rules/test-idExemple Réponse
{
"id": "test-id",
"product": "sms",
"prefix": "44",
"direction": "from",
"traffic_direction": "outbound",
"action": "block",
"reason": "My custom prefix rule",
"permission": "edit",
"status": "active",
"created_timestamp": "2022-12-09T18:19:26",
"updated_timestamp": "2022-11-09T18:19:26",
"archived_timestamp": "2022-10-09T18:19:26",
"_links": {
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/rules/test-id"
}
}
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
My custom prefix ruleHuman readable reason
Exemple Demande
{
"reason": "My custom prefix rule"
}{
"reason": "My custom prefix rule"
}test-idsmsvoicesms44The prefix attribute is used to check whether a phone number begins with a particular sequence of digits. It's not related to phone number prefixes.
fromfromtooutboundoutboundOutbound rules apply to traffic generated from you API Key. Inbound rules apply to traffic sent to your phone numbers.
blockblockallowMy custom prefix ruleHuman readable reason
editvieweditactiveactivearchived2022-12-09T18:19:262022-11-09T18:19:262022-10-09T18:19:26https://api.nexmo.com/v0.1/fraud-defender/rules/test-idExemple Réponse
{
"id": "test-id",
"product": "sms",
"prefix": "44",
"direction": "from",
"traffic_direction": "outbound",
"action": "block",
"reason": "My custom prefix rule",
"permission": "edit",
"status": "active",
"created_timestamp": "2022-12-09T18:19:26",
"updated_timestamp": "2022-11-09T18:19:26",
"archived_timestamp": "2022-10-09T18:19:26",
"_links": {
"self": {
"href": "https://api.nexmo.com/v0.1/fraud-defender/rules/test-id"
}
}
}Erreurs
Voici une liste non exhaustive des codes d'erreur susceptibles de se produire lors de l'utilisation de cette API.
Ces codes s'ajoutent à ceux de notre site codes d'erreur génériques.
| Code | Informations |
|---|---|
| http:error:conflict | Rule couldn't be added as conflicts with currently existing rules |
| system:error:internal-error | Something went wrong. |