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.
Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
Consulta Parâmetros
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
Exemplo Resposta
{
"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"
}
}
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
SMSProduct type (SMS or VOICE)
VOICESMSGBISO country code
6010Exemplo Solicitação
{
"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
Exemplo Resposta
{
"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"
}
}
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
SMSProduct type (SMS or VOICE)
VOICESMSGBISO country code
6010Exemplo Solicitação
{
"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
Exemplo Resposta
{
"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"
}
}
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | 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
Exemplo Resposta
{
"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"
}
}
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
Operações disponíveis
Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | 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/SMSExemplo Resposta
{
"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"
}
}
}
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | 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
highstandardnoneExemplo Solicitação
{
"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/SMSExemplo Resposta
{
"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"
}
}
}
}Operações disponíveis
Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | 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
blockblockallowactiveactivearchivedExemplo Solicitação
{
"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-idExemplo Resposta
{
"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"
}
}
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
Consulta Parâmetros
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-idExemplo Resposta
{
"_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"
}
}
}
]
}
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | 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-idExemplo Resposta
{
"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"
}
}
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
My custom prefix ruleHuman readable reason
Exemplo Solicitação
{
"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-idExemplo Resposta
{
"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"
}
}
}Erros
A seguir, apresentamos uma lista não exaustiva de códigos de erro que podem ocorrer durante o uso desta API.
Esses códigos são adicionais aos que constam em nosso site códigos de erro genéricos.
| Código | Informações |
|---|---|
| http:error:conflict | Rule couldn't be added as conflicts with currently existing rules |
| system:error:internal-error | Something went wrong. |