Here is the black and red list interface v2

Note that the use of this interface requires interface authentication

Add black and red list interface

  • HTTP request method:POST

  • Authentication method: Interface Authentication

  • Request url:{HOST}/v20160818/blacknum/saveBlackList/accountId?sig=sig

  • When requesting, please replace {HOST} with connection data queryDomain name,ACCOUNTID is replaced with the account number, SIG is generated according to the authentication rules, please see the authentication document to see the specific generation rules.

Request frequency limit:

20 times / minute

Request body

Field Types Is necessary Remark
PBX String Single pbx account is not required, multiple pbx accounts are required The address of the server where the account is located can be accessed from
BlackNum String yes Number collection, separated by commas, such as 133xxxxxxxx,187xxxxxxxx,.......
Type String yes List type:
0:Inbound Red List
1:Inbound blacklist
2:Outbound Blacklist

Note: Up to 1000 numbers can be placed in BlackNum.

Request body example

{
    "BlackNum": "133xxxxxxxx,187xxxxxxxx”,
    "Type": "2"
}

return value:

Field meaning
code Response code
message Response message
goodmessage When the request is successful, the data that has been successfully operated is returned
badmessage When the request is successful, unsuccessful data is returned

code:

Code meaning
200 Request succeeded
400 Request body parameter error
402 Parameter error
403 Interface access frequency reaches the upper limit or authentication fails
500 Server Error

Returns 200 examples

{
    "code": 200,
    "message": "success!",
    "goodmessage": "18585858585 is ok !"
}
{
    "code": 200,
    "message": "success!",
    "badmessage": "18103481234 BlackNum is Exist!",
    "goodmessage": "18585858585 is ok !"
}

Returns 400 examples:

{
    "code": 400,
    "message": "Please check your parameters"
}

Returns 402 examples:

{
    "code": 402,
    "message": "Account or PBX is not found!"
}

Returns 403 examples:

{
    "code": 403,
    "message": "Server is busy, max request frequency is 20/min"
}

Returns 500 examples:

{
    "code": 500,
    "message": {
        "code": "ENOTFOUND",
        "errno": "ENOTFOUND",
        "syscall": "getaddrinfo"
    }
}

Delete the black and red list interface

  • HTTP request method:POST

  • Request url:{HOST}/v20160818/blacknum/delBlackList/accountId?sig=SIG

  • When requesting, please replace {HOST} with connection data queryDomain name,ACCOUNTID is replaced with the account number, SIG is generated according to the authentication rules, please see the authentication document to see the specific generation rules.

  • Authentication document: Interface Authentication

Example:

Request frequency limit:

20 times / minute

Request body

Field Types Is necessary Remark
PBX String Single pbx account is not required, multiple pbx accounts are required The address of the server where the account is located can be accessed from
BlackNum String yes Number collection, separated by commas, such as 133xxxxxxxx,187xxxxxxxx,.......
Type String yes List type:
0:Inbound Red List
1:Inbound blacklist
2:Outbound Blacklist

Note: Up to 1000 numbers can be placed in BlackNum.

Request body example

{
    "BlackNum": "133xxxxxxxx,187xxxxxxxx”,
    "Type": "2"
}

return value:

Field meaning
code Response code
message Response message
goodmessage When the request is successful, the data that has been successfully operated is returned
badmessage When the request is successful, unsuccessful data is returned

code:

Code meaning
200 Request succeeded
400 Request body parameter error
402 Parameter error
403 Interface access frequency reaches the upper limit or authentication fails
500 Server Error

Returns 200 examples:

{
    "code": 200,
    "message": "success!",
    "goodmessage": "18585858585 is ok !"
}
{
    "code": 200,
    "message": "success!",
    "badmessage": "18103481234 BlackNum not Exist!",
    "goodmessage": "18585858585 is ok !"
}

Returns 400 examples:

{
    "code": 400,
    "message": "Please check your parameters"
}

Returns 402 examples:

{
    "code": 402,
    "message": "Account or PBX is not found!"
}

Returns 403 examples:

{
    "code": 403,
    "message": "Server is busy, max request frequency is 20/min"
}

Returns 500 examples:

{
    "code": 500,
    "message": {
        "code": "ENOTFOUND",
        "errno": "ENOTFOUND",
        "syscall": "getaddrinfo"
    }
}

Query the black and red list

example:

Request body example

{"pbx":"test.ali.1.0",”type” : “1”}

type: 1 blacklist for checking incoming calls 0 blacklist for checking red 2 blacklist for checking outgoing

pbx is mandatory, type not mandatory

返回示例:

{
  "Succeed": true,
  "Response": "queryRedOrBlackNum",
  "list": [
    {
      "_id": "ea8fe02b-f13e-4235-8517-2ba86e42bc85",
      "Type": "callInBlackNum",//Inbound blacklist
      "Num": "057128070127"
    },
    {
      "_id": "2a8ae623-3e31-4634-b1ed-193e62643e2d",
      "Type": "redNum",//Red list
      "Num": "15010457346"
    },
    {
      "_id": "6b379f82-485a-4e82-b0b1-ad48b4929d22",
      "Type": "callInBlackNum",
      "Num": "13836953645"
    },
    {
      "_id": "6dc5a331-ab41-475a-88c2-0401365df4ee",
      "Num": "13836953644",
      "Type": "callOutNum"//Outbound Blacklist
    }
  ]
}