logo

CCPaaS Application Side API

Common Information

General Description

1 Interface Specification

1.1 Request Format

Base URL https://{host}/{Type}/{version}/{api}?Timestamp={Timestamp}&AppId={AppId}&Token={Token}

  • host: API domain name

  • Type: API

  • version: API version, currently v1

  • api: See API URI for specifics

  • Timestamp: UTC timestamp, accurate to the second

  • AppId: Used to indicate which APP to operate on, UUID string, should be included except for creating an APP

  • Token: Authentication Token calculated according to the authentication method, refer to section 2 for calculation HTTP Header

  • Accept: "application/json"

  • Content-Type: "application/json;charset=utf-8"

HTTP METHOD

  • GET (SELECT): Retrieve resources (one or more) from the server.

  • POST (CREATE): Create a new resource on the server.

  • PUT (UPDATE): Update a resource on the server (the client provides the complete resource with changes).

  • PATCH (UPDATE): Update a resource on the server (the client provides the attributes with changes).

  • DELETE (DELETE): Delete a resource from the server.

HTTP Status Code

  • 200 OK - [GET]: The server successfully returns the data requested by the user, and this operation is idempotent (Idempotent).

  • 201 CREATED - [POST/PUT/PATCH]: The user successfully creates or modifies data.

  • 202 Accepted - [-]: Indicates that a request has entered the background queue (asynchronous task)

  • 204 NO CONTENT - [DELETE]: The user successfully deletes data.

  • 400 INVALID REQUEST - [POST/PUT/PATCH]: The request made by the user is incorrect, the server does not perform the operation of creating or modifying data, and this operation is idempotent.

  • 401 Unauthorized - [-]: Indicates that the user does not have permission (token, username, password error).

  • 403 Forbidden - [-]: It means that the user is authorized (opposite to the 401 error), but the access is forbidden.

  • 404 NOT FOUND - [-]: The request made by the user is for a non-existent record, the server does not perform any operation, and this operation is idempotent.

  • 406 Not Acceptable - [GET]: The format requested by the user is not available (for example, the user requests JSON format, but only XML format is available).

  • 410 Gone - [GET]: The resource requested by the user has been permanently deleted and will not be obtained again.

  • 422 Unprocessable Entity - [POST/PUT/PATCH] When creating an object, a validation error occurs.

  • 500 INTERNAL SERVER ERROR - [-]: An error occurs on the server, and the user will not be able to determine whether the request sent was successful.

1.2 Response Format

General

  • Responses are in JSON format encoded in UTF-8
  • Response codes refer to HTTP Status Code Successful Response Format
{
"succeed":true,
"code":200,
"bizCode":"000000",
"message":"OK",
"visible":false,
"data":{
// data
}
}

Error Response Format

{
"succeed":false,
"code":401,
"bizCode":"000000",
"message":"error info",  // error message
"visible":false,
"data":{
// data
}
}

2 Authentication Method

Authentication Parameters Description

Parameter NameRequiredRemarks
AppIdYesTenant ID
TimestampYesUTC timestamp, accurate to the second
TokenYesAuthentication signature, valid for 5 minutes

The Token is obtained by encrypting with the HMAC-SHA1 algorithm, where the message to be encrypted is obtained by adding AppId and Timestamp. The Secret used for encryption needs to be obtained from the administrator.

  • Message to be encrypted: Tenant ID + Timestamp

For example: a54a8b77-f12d-4ac9-742d-5b2bef5c4d111612513422, where a54a8b77-f12d-4ac9-742d-5b2bef5c4d11 is the tenant ID, and 1612513422 is the timestamp

  • Encryption Secret: Obtain from the administrator

Note: All interface calls need to carry the signature parameter Token, and the request will only be accepted when the Token value is valid.

Example

Suppose you want to call the following interface:

https://demo.udesk.cn/api/v1/petitions/search

The authentication data required is as follows:

NameData
AppIda54a8b77-f12d-4ac9-742d-5b2bef5c4d11
Timestamp1612513422
Secretsecret-1234567890abc

Calculate Token (Java example code)

    HmacUtils hmacUtils = new HmacUtils(HmacAlgorithms.HMAC_SHA_1, "secret-1234567890abc");
    hmacUtils.hmacHex("a54a8b77-f12d-4ac9-742d-5b2bef5c4d11"+"1612513422")
    
    -> Token: e44a3e72aa3bd8cb903f72eacd4126682d1e7ff7

Note:

  1. Token generation can refer to the website: https://1024tools.com/hmac
  2. This request is for an automated outbound call interface and requires additional Email parameter authentication; this parameter is not required for ordinary interfaces The final request URL:
https://demo.udesk.cn/api/v1/petitions/search?AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Timestamp=1612513422&Token=e44a3e72aa3bd8cb903f72eacd4126682d1e7ff7

Open API

01 Create Outbound Call Task

Basic Information

Path: /api/v1/ads/external/callTasks?Email={Email}
Method: POST
Interface Description:

Overview

This API is used to create a new automatic outbound call task.

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/ads/external/callTasks?Email=1@test.cn&AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X POST -H 'Content-Type: application/json' -d '{
    
        "name":"test Dialing1",
        "remark":"test Dialing",
        "callTemplateId":5,
        "ivrId":1,
        "queueId":11,
        "spnumberType":1,
        "spnumberValue":72,
        "startMode":1,
        "startTime":null,
        "workTimeId":31,
        "priority":1,
        "controlOptionList":[
            1
        ],
        "ivrMode":0,
        "callType":1,
        "concurrentLimit":1,
        "dialParam":{
            "optimizeParam":1,
            "optimizeTarget":1
        },
        "redialSceneList":[
            {
                "result":"User declined",
                "dealOption":1,
                "redialTimes":1,
                "redialGuide":1,
                "guideIncrement":1,
                "nextDeal":1
            }
        ],
        "taskContactBatchRelList":[
            {
                "callWeight":100,
                "contactBatchId":3
            }
        ]
      }'

Response Example

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed":true,
        "code":200,
        "bizCode":"000000",
        "message":"OK",
        "visible":false,
        "data":{
            "id":80,
            "name":"test Dialing1",
            "remark":"test Dialing",
            "callTemplateId":5,
            "ivrId":1,
            "queueId":11,
            "spnumberType":1,
            "spnumberValue":72,
            "startMode":1,
            "startTime":null,
            "workTimeId":31,
            "priority":1,
            "controlOption":"1",
            "controlOptionList":[
                1
            ],
            "status":1,
            "ivrMode":0,
            "callType":1,
            "dialParam":{
                "optimizeParam":1,
                "optimizeTarget":1
            },
            "concurrentLimit":1,
            "taskContactBatchRelList":[
                {
                    "contactBatchId":3,
                    "callWeight":100
                }
            ],
            "redialSceneList":[
                {
                    "result":"User declined",
                    "dealOption":1,
                    "redialTimes":1,
                    "redialGuide":1,
                    "guideIncrement":1,
                    "nextDeal":1
                }
            ]
        }
    }

Request Parameters

Headers

Parameter NameParameter ValueRequiredExampleRemarks
Content-Typeapplication/jsonYes

Body

NameTypeRequiredDefaultRemarksAdditional Information
namestringRequiredTask namemock: test
remarkstringNot RequiredDescription
callTemplateIdnumberRequiredOutbound call template IDmock: 1
ivrIdnumberNot RequiredOutbound IVR ID
queueIdnumberNot RequiredOutbound queue ID
spnumberTypenumberRequiredCaller number type (1 - trunk number, 2 - number pool)
spnumberValuenumberRequiredCaller number value
startModenumberRequiredStart mode (1 - manual, 2 - timed, 3 - periodic start)
startTimestringNot RequiredStart time (used for timed, format: yyyy-MM-dd HH:mm:ss)
workTimeIdnumberRequiredWork time ID
prioritynumberRequiredTask priority
controlOptionListnumber[]Not RequiredTask option setItem Type: number
└─Not RequiredcontrolOptionList
ivrModenumberNot RequiredIVR mode (0 - off, 1 - on)
callTypenumberNot RequiredOutbound call mode (1 - predictive mode, 3 - precise mode, 6 - precise IVR mode, 7 - pure IVR mode)
concurrentLimitnumberRequiredTask concurrency limit
dialParamobjectNot RequiredDialing setting parameters
└─ optimizeParamnumberNot RequiredOptimization parameter (1 - agent utilization, 2 - abandoned call rate, 3 - average agent waiting time)
└─ optimizeTargetnumberNot RequiredOptimization target
redialSceneListobject[]Not RequiredRedial option setItem Type: object
└─ resultstringNot RequiredCall result (power off, empty number, suspended, busy, user rejection, unable to connect, service suspended, user busy, incorrect dialing method, inbound restriction, call transfer failure, network busy, no answer, arrears, unable to answer, number change, line fault, call back later, other)
└─ dealOptionnumberRequiredHandling method (1 - redial)
└─ redialTimesnumberNot RequiredRedial attempts
└─ redialGuidenumberNot RequiredTime interval (minutes)
└─ guideIncrementnumberNot RequiredInterval increment (minutes)
└─ nextDealnumberRequiredSubsequent processing (1 - next contact's phone)
└─ typenumberRequiredCall result type (1 - invalid call, 2 - failed call, 3 - label)
taskContactBatchRelListobject[]Not RequiredContact batch setItem Type: object
└─ callWeightnumberNot RequiredCall weight
└─ contactBatchIdnumberNot RequiredContact batch ID

Response Data

NameTypeRequiredDefaultRemarkAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code
bizCodestringRequiredBusiness code (not in use)
messagestringRequiredMessage
visiblebooleanRequiredVisibility (not in use)
dataobjectNot RequiredResult
├─ idnumberRequiredTask ID
├─ namestringRequiredTask name
├─ remarkstringNot RequiredDescription
├─ callTemplateIdnumberRequiredCall template ID
├─ ivrIdnumberNot RequiredIVR ID
├─ queueIdnumberNot RequiredQueue ID
├─ spnumberTypenumberRequiredCaller number type (1 - Trunk number, 2 - Number pool)
├─ spnumberValuenumberRequiredCaller number value
├─ startModenumberRequiredStart mode (1 - Manual, 2 - Timed, 3 - Periodic)
├─ startTimenullNot RequiredStart time (used for timing, format: yyyy-MM-dd HH:mm:ss)
├─ workTimeIdnumberRequiredWork time ID
├─ prioritynumberRequiredTask priority
├─ controlOptionstringNot RequiredTask options
├─ controlOptionListnumber[]Not RequiredTask options (enumerated integer array, 1 - Stop automatically if no contacts)Item Type: number
├─Not RequiredTask option enum values
├─ statusnumberRequiredStatus (1 - Paused, 2 - Running, 3 - Stopped, 4 - Pausing, 5 - Stopping)
├─ ivrModenumberRequiredIVR mode (0 - Off, 1 - On)
├─ callTypenumberRequiredCall mode (1 - Predictive mode, 3 - Precision mode, 6 - Precision IVR mode, 7 - Pure IVR mode)
├─ dialParamobjectNot RequiredDialing settings parameters
├─ optimizeParamnumberNot RequiredOptimization parameter (1 - Agent utilization, 2 - Abandon call rate, 3 - Average agent wait time)
├─ optimizeTargetnumberNot RequiredOptimization target
├─ concurrentLimitnumberNot RequiredTask concurrency limit
├─ taskContactBatchRelListobject[]Not RequiredContact batch collectionItem Type: object
├─ contactBatchIdnumberNot RequiredContact batch ID
├─ callWeightnumberNot RequiredCall weight
├─ redialSceneListobject[]Not RequiredRedial option collectionItem Type: object
├─ resultstringNot RequiredCall result (Off, No answer, Out of service, Busy, User rejection, Unable to connect, Service suspended, User busy, Incorrect dialing method, Call-in restriction, Call transfer failed, Network busy, No answer, Arrears, Unable to answer, Number change, Line fault, Call back later, Other)
├─ dealOptionnumberRequiredHandling method (1 - Redial)
├─ redialTimesnumberNot RequiredRedial attempts
├─ redialGuidenumberNot RequiredTime interval (minutes)
├─ guideIncrementnumberNot RequiredInterval increment (minutes)
├─ nextDealnumberNot RequiredSubsequent processing (1 - Next contact phone)
├─ typestringNot RequiredCall result type (1 - Invalid call, 2 - Call failure, 3 - Label)
├─ validstringNot RequiredValidity (default is invalid -2)
├─ labelInfosstring[]Not Required

02 Edit Outbound Call Task

Basic Information

Path: /api/v1/ads/external/callTasks/{id}
Method: PUT
Interface Description:

Overview

Modify Automatic Outbound Call Task Data

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/ads/external/callTasks/80?Email=1@test.cn&AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X PUT -H 'Content-Type: application/json' -d '{
    
        "name":"test Dialing1",
        "remark":"test Dialing",
        "callTemplateId":5,
        "ivrId":1,
        "queueId":11,
        "spnumberType":1,
        "spnumberValue":72,
        "startMode":1,
        "startTime":null,
        "workTimeId":31,
        "priority":1,
        "controlOptionList":[
            1
        ],
        "ivrMode":0,
        "callType":1,
        "concurrentLimit":1,
        "dialParam":{
            "optimizeParam":1,
            "optimizeTarget":1
        },
        "redialSceneList":[
            {
                "result":"User declined",
                "dealOption":1,
                "redialTimes":1,
                "redialGuide":1,
                "guideIncrement":1,
                "nextDeal":1
            }
        ],
        "taskContactBatchRelList":[
            {
                "callWeight":100,
                "contactBatchId":3
            }
        ]
      }'

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed":true,
        "code":200,
        "bizCode":"000000",
        "message":"OK",
        "visible":false,
        "data":{
            "id":80,
            "name":"test Dialing1",
            "remark":"test Dialing",
            "callTemplateId":5,
            "ivrId":1,
            "queueId":11,
            "spnumberType":1,
            "spnumberValue":72,
            "startMode":1,
            "startTime":null,
            "workTimeId":31,
            "priority":1,
            "controlOption":"1",
            "controlOptionList":[
                1
            ],
            "status":1,
            "ivrMode":0,
            "callType":1,
            "dialParam":{
                "optimizeParam":1,
                "optimizeTarget":1
            },
            "concurrentLimit":1,
            "taskContactBatchRelList":[
                {
                    "contactBatchId":3,
                    "callWeight":100
                }
            ],
            "redialSceneList":[
                {
                    "result":"User declined",
                    "dealOption":1,
                    "redialTimes":1,
                    "redialGuide":1,
                    "guideIncrement":1,
                    "nextDeal":1
                }
            ]
        }
    }

Request Parameters

Headers

Parameter NameParameter ValueMandatoryExampleNotes
Content-Typeapplication/jsonYes

Path Parameters

Parameter NameExampleNotes
id1Task ID

Body

NameTypeRequiredDefaultRemarkAdditional Information
namestringNot RequiredTask namemock: test
remarkstringNot RequiredDescription
callTemplateIdnumberNot RequiredOutbound call template IDmock: 1
ivrIdnumberNot RequiredOutbound IVR ID
queueIdnumberNot RequiredOutbound queue ID
spnumberTypenumberRequiredCaller number type (1: Trunk number 2: Number pool)
spnumberValuenumberNot RequiredCaller number value
startModenumberNot RequiredStart mode (1: Manual 2: Timed 3: Periodic start)
startTimestringNot RequiredStart time (used for timing, format: yyyy-MM-dd HH:mm:ss)
workTimeIdnumberNot RequiredWork time ID
prioritynumberNot RequiredTask priority
controlOptionListnumber[]Not RequiredTask option setItem type: number
├─Not RequiredcontrolOptionList
ivrModenumberNot RequiredIVR mode (0: Off 1: On)
callTypenumberRequiredOutbound mode (1: Predictive mode 3: Precision mode 6: Precision IVR mode 7: Pure IVR mode)
concurrentLimitnumberNot RequiredTask concurrency limit
dialParamobjectNot RequiredDialing settings parameters
├─ optimizeParamnumberNot RequiredOptimization parameter (1: Agent utilization 2: Abandon call rate 3: Average agent wait time)
├─ optimizeTargetnumberNot RequiredOptimization target
redialSceneListobject[]Not RequiredRedial option setItem type: object
├─ resultstringNot RequiredCall result (Off, Empty number, Suspended, Busy, User rejection, Unable to connect, Service suspended, User busy, Incorrect dialing method, Inbound restriction, Call transfer failure, Network busy, No answer, Arrears, Unable to answer, Number change, Line fault, Call back later, Other)
├─ dealOptionnumberNot RequiredHandling method (1: Redial)
├─ redialTimesnumberNot RequiredRedial attempts
├─ redialGuidenumberNot RequiredTime interval (minutes)
├─ guideIncrementnumberNot RequiredInterval increment (minutes)
├─ nextDealnumberNot RequiredSubsequent processing (1: Next contact's phone number)
├─ typestringNot RequiredCall result type (1: Invalid call 2: Call failure 3: Tag)
taskContactBatchRelListobject[]Not RequiredContact batch setItem type: object
├─ callWeightnumberNot RequiredCall weight
├─ contactBatchIdnumberRequiredContact batch ID

Response Data

NameTypeRequiredDefaultRemarkAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code
bizCodestringRequiredBusiness code (not in use)
messagestringRequiredMessage
visiblebooleanRequiredVisibility (not in use)
dataobjectNot requiredResult
├─ idnumberRequiredTask ID
├─ namestringRequiredTask name
├─ remarkstringNot requiredDescription
├─ callTemplateIdnumberRequiredCall template ID
├─ ivrIdnumberNot requiredIVR ID
├─ queueIdnumberNot requiredQueue ID
├─ spnumberTypenumberRequiredCaller number type (1 trunk number 2 number pool)
├─ spnumberValuenumberRequiredCaller number value
├─ startModenumberRequiredStart mode (1 manual 2 timed 3 periodic)
├─ startTimenullNot requiredStart time (used for timed tasks, format: yyyy-MM-dd HH:mm:ss)
├─ workTimeIdnumberRequiredWork time ID
├─ prioritynumberRequiredTask priority
├─ controlOptionstringNot requiredTask options
├─ controlOptionListnumber[]Not requiredTask options (enumerated integer array, 1 stop if no contacts)item type: number
├─Not requiredTask option enum values
├─ statusnumberRequiredStatus (1 paused 2 running 3 stopped 4 pausing 5 stopping)
├─ ivrModenumberRequiredIVR mode (0 off 1 on)
├─ callTypenumberRequiredCall mode (1 predictive mode 3 precision mode 6 precision IVR mode 7 pure IVR mode)
├─ dialParamobjectNot requiredDialing settings
├─ optimizeParamnumberNot requiredOptimization parameter (1 agent utilization 2 abandoned call rate 3 average agent wait time)
├─ optimizeTargetnumberNot requiredOptimization target
├─ concurrentLimitnumberNot requiredTask concurrency limit
├─ taskContactBatchRelListobject[]Not requiredContact batch collectionitem type: object
├─ contactBatchIdnumberNot requiredContact batch ID
├─ callWeightnumberNot requiredCall weight
├─ redialSceneListobject[]Not requiredRedial option collectionitem type: object
├─ resultstringNot requiredCall result (powered off, empty number, suspended, busy, user rejection, unable to connect, service suspended, user busy, incorrect dialing method, inbound restriction, call transfer failure, network busy, no answer, arrears, unable to answer, number change, line fault, call back later, other)
├─ dealOptionnumberRequiredHandling method (1 redial)
├─ redialTimesnumberNot requiredRedial attempts
├─ redialGuidenumberNot requiredTime interval (minutes)
├─ guideIncrementnumberNot requiredInterval increment (minutes)
├─ nextDealnumberNot requiredSubsequent processing (1 next contact phone)

03 Start Outbound Call Task

Basic Information

Path: /api/v1/ads/external/callTasks/status/{id}/executing
Method: PUT
Interface Description:

Overview

This API endpoint is used to start an outbound call task.

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/ads/external/callTasks/status/1/executing?Email=1@test.cn&AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X PUT -H 'Content-Type: application/json'

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed":true,
        "code":200,
        "bizCode":"000000",
        "message":"OK",
        "visible":false
    }

Request Parameters

Headers

Parameter NameParameter ValueMandatoryExampleNotes
Content-Typeapplication/x-www-form-urlencodedYes

Path Parameters

Parameter NameExampleNotes
id1Task ID

Response Data

NameTypeMandatoryDefault ValueNotesAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code
bizCodestringRequiredBusiness code (not in use)
messagestringRequiredMessage
visiblebooleanRequiredVisibility (not in use)

04 Pause Outbound Call Task

Basic Information

Path: /api/v1/ads/external/callTasks/status/{id}/pause
Method: PUT
Interface Description:

Overview

This API endpoint is used to pause an outbound call task.

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/ads/external/callTasks/status/1/pause?Email=1@test.cn&AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X PUT -H 'Content-Type: application/json'

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed":true,
        "code":200,
        "bizCode":"000000",
        "message":"OK",
        "visible":false
    }

Request Parameters

Headers

Parameter NameParameter ValueRequiredExampleNotes
Content-Typeapplication/x-www-form-urlencodedYes

Path Parameters

Parameter NameExampleNotes
id1Task ID

Response Data

NameTypeRequiredDefaultNotesAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code
bizCodestringRequiredBusiness code (not in use)
messagestringRequiredMessage
visiblebooleanRequiredVisibility (not in use)

Basic Information

Path: /api/v1/ads/external/callTasks/status/{id}/stop
Method: PUT
Interface Description:

Overview

Stop Outbound Call Task

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/ads/external/callTasks/status/1/stop?Email=1@test.cn&AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X PUT -H 'Content-Type: application/json'

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed":true,
        "code":200,
        "bizCode":"000000",
        "message":"OK",
        "visible":false
    }

Request Parameters

Headers

Parameter NameParameter ValueRequiredExampleNotes
Content-Typeapplication/x-www-form-urlencodedYes

Path Parameters

Parameter NameExampleNotes
id1Task ID

Response Data

NameTypeRequiredDefaultNotesAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code
bizCodestringRequiredBusiness code (not in use)
messagestringRequiredMessage
visiblebooleanRequiredVisibility (not in use)

06 Creating a Contact Form

Basic Information

Path: /api/v1/ads/external/contactBatchs
Method: POST
Interface Description:

Overview

Creating a Contact Ticket

Example

Request

      $ curl 'https://demo.udesk.cn/api/v1/ads/external/contactBatchs?Email=1@test.cn&AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X POST -H 'Content-Type: application/json' -d '{
    
        "name":"Test Dial 1",
        "remark":"Test Dial",
        "focus":"Tag"
      }'

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed":true,
        "code":200,
        "bizCode":"000000",
        "message":"OK",
        "visible":false,
        "data":{
            "id":80,
            "name":"Test Dial 1",
            "remark":"Test Dial",
            "focus":"Tag",
            "status":3
        }
    }

Request Parameters

Headers

Parameter NameParameter ValueRequiredExampleNotes
Content-Typeapplication/jsonYes

Body

NameTypeRequiredDefaultRemarksAdditional Information
namestringRequiredContact form name
remarkstringNot RequiredNote
focusstringNot RequiredLabel
callTaskIdstringRequiredOutbound task ID

Response Data

NameTypeRequiredDefaultRemarksAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code
bizCodestringRequiredBusiness code (not in use)
messagestringRequiredMessage
visiblebooleanRequiredVisibility (not in use)
dataobjectNot RequiredResult
├─ idstringRequiredContact form ID
├─ namestringRequiredContact form name
├─ remarkstringNot RequiredRemarks
├─ focusstringNot RequiredTags
├─ statusstringRequiredStatus (1: waiting, 2: importing, 3: completed)

07 Import Contact Numbers

Basic Information

Path: /api/v1/ads/external/contactBatchs/syncNumber
Method: POST
Interface Description:

Overview

Import Contact Numbers Interface (Single Limit of 50 Entries)

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/ads/external/contactBatchs/syncNumber?Email=1@test.cn&AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X POST -H 'Content-Type: application/json' -d '{
    
        "contactBatchId":1,
        "dealType": 1,
        "encryptionFlag": 1,
        "algorithmType": 1,
        "secretKey": "MTIzNDU2",
        "encryptionRange": ["name,mobile"],
        "numberList":[
            {
                "name":"test 1",
                "mobile":"13900000000",
                "companyName":"test company 1",
                "remark":"Note1",
                "variates":[{"key":"Weather","type":"string","value":"New York"}]
            },
            {
                "name":"test 2",
                "mobile":"1390000001",
                "companyName":"test company 2",
                "remark":"Note2",
                "variates":[{"key":"Weather","type":"string","value":"New York"}]
            }
        ]
      }'

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed":true,
        "code":200,
        "bizCode":"000000",
        "message":"OK",
        "visible":false,
        "data":{
            "contactBatchId":1,
            "successCount":1,
            "failedCount":1,
            "failedNumberList":[
               {
                   "name":"test 2",
                   "mobile":"1390000001",
                   "companyName":"test company 2",
                   "remark":"Note2",
                   "variates":[{"key":"Weather","type":"string","value":"New York"}],
                   "failedReason":"Invalid number"
               }
           ]
        }
    }

Request Parameters

Headers

Parameter NameParameter ValueRequiredExampleNotes
Content-Typeapplication/jsonYes

Body

NameTypeRequiredDefaultRemarksAdditional Information
contactBatchIdnumberRequiredContact form ID
dealTypenumberOptionalDuplicate processing type (1 global, 2 all tasks, 3 current task, 4 no duplicate check)
encryptionFlagnumberRequired0Whether to encrypt (1 yes, 0 no)
algorithmTypenumberOptionalEncryption algorithm (1 AES, 2 DES)
secretKeystringOptionalEncryption key (requires base64 encryption)
encryptionRangelistOptionalEncryption fields
numberListobject[]RequiredNumber list collectionItem type: object
├─ namestringRequiredContact name
├─ mobilestringRequiredMobile number
├─ companyNamestringOptionalCompany
├─ remarkstringOptionalRemarks
├─ variatesobject[]OptionalCustom variablesItem type: object
├─ keystringOptionalVariable
├─ typestringOptionalVariable type
├─ valuestringOptionalVariable value

Response Data

NameTypeRequiredDefaultRemarksAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code
bizCodestringRequiredBusiness code (not in use)
messagestringRequiredMessage
visiblebooleanRequiredVisibility (not in use)
dataobjectNot RequiredResult
├─ contactBatchIdnumberRequiredContact form ID
├─ successCountnumberRequiredNumber of successfully imported numbers
├─ failedCountnumberRequiredNumber of failed imports
├─ failedNumberListobject[]Not RequiredSet of failed import numbersItem Type: object
├─ namestringNot RequiredName
├─ mobilestringNot RequiredNumber
├─ companyNamestringNot RequiredCompany
├─ remarkstringNot RequiredRemarks
├─ variatesstring[]Not RequiredCustom variables (format: [{"key":"weather","type":"string","value":"Beijing"}])Item Type: string
├─ failedReasonstringNot RequiredReason for failure
├─ dealTypenumberNot RequiredDuplicate handling type (1 global, 2 all tasks, 3 current task, 4 no duplicate check)
├─ encryptionFlagnumberRequiredEncryption flag
├─ algorithmTypenumberNot RequiredEncryption type
├─ encryptionRangelistNot RequiredEncryption fields
├─ encryptionFieldstringNot RequiredEncryption field

08 Call Record Inquiry

Basic Information

Path: /api/v1/petitions/search
Method: POST
Interface Description:

Overview

The call record query supports querying by time range, call type, and call ID. The query time range cannot exceed 7 days; the larger the time range, the longer the query time, so it's advisable to minimize the query range.

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/petitions/search?AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X POST -H 'Content-Type: application/json' -d '{
       "pageNum": 1,
       "pageSize": 1,
       "startTime": "2021-06-26 00:00:28",
       "endTime": "2021-06-26 10:00:28",
       "category": 2,
       "callId": "d44539e0-3d41-4854-83da-d22a0d251304"
    }'
Response
    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed": true,
        "code": 200,
        "bizCode": "000000",
        "message": "OK",
        "visible": false,
        "paging": {
            "pageNum": 1,
            "pageSize": 1,
            "total": 1
        },
        "data": [
            {
                "id": 16938727,
                "callId": "d44539e0-3d41-4854-83da-d22a0d251304",
                "category": 2,
                "customerNumber": "18710180975",
                "beginAt": "2021-06-26 00:09:28",
                "endAt": "2021-06-26 00:09:51",
                "defeatCause": null,
                "displayNumber": "04536341334",
                "agentName": "test ",
                "customerRingingTime": 0,
                "talkRecord": "https://s4-ccps-pri-std.obs.cn-north-4.myhuaweicloud.com/c055e127-95d0-44f0-7564-5f570d410b68/cc_recordings/20210626000945_d44539e0-3d41-4854-83da-d22a0d251304_a5138e4d-5eec-4d5f-bc1d-6cf9c5a0eacf_18710180975.mp3?AWSAccessKeyId=KNERXMMZRQZ7UHV2OSEN&Expires=1656173390&Signature=Pb%2BSiPvi9GtFvLIm98nyJV0CHZE%3D",
                "outLineNumber": "",
                "talkTime": 5,
                "followUpCall": "None",
                "queueName": "Liu Yong - Queue",
                "queueResult": "Queue Success",
                "ringResult": "agent Answer",
                "seqRing": "0",
                "outCallRingTime": null,
                "outCallDefeatCause": null,
                "hangupBy": "Agent",
                "callResult": "agent Answer",
                "agentInfo": {
                    "id": 10001,
                    "name": "test ",
                    "employeeId": "Agent-001",
                    "number": "99674238501001"
                },
                "talkInfo": null,
                "ivrInfo": null,
                "phoneInfo": null,
                "queueInfo": null,
                "surveryList": [
                    "Evaluated-1-12"
                ]
            }
        ]
    }

Request Parameters

Headers

Parameter NameParameter ValueRequiredExampleNotes
Content-Typeapplication/jsonYes

Body

NameTypeRequiredDefaultRemarksAdditional Information
pageNumnumberNot RequiredPage number
pageSizenumberNot RequiredRows per page
startTimestringNot RequiredStart time, for example: 2021-02-24 18:50:00
endTimestringNot RequiredEnd time, for example: 2021-02-24 19:50:00
categorynumberNot RequiredCall type 1: Outgoing 2: Incoming
callIdstringNot RequiredUnique call identifier

Response Data

NameTypeRequiredDefaultRemarksAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code. 200 for success
bizCodestringRequiredbizcode
messagestringRequiredMessage
visiblebooleanRequiredvisible
pagingobjectRequiredPaging information
├─ pageNumnumberRequiredPage number
├─ pageSizenumberRequiredRows per page
├─ totalnumberRequiredTotal count
dataobject[]Not RequiredResult dataItem type: object
├─ idnumberRequiredUnique sequence
├─ callIdstringRequiredCall ID
├─ categorynumberRequiredCall type 1: Outgoing 2: Incoming
├─ customerNumberstringNot RequiredCustomer phone number
├─ beginAtstringRequiredCall time
├─ endAtstringRequiredEnd time
├─ displayNumberstringNot RequiredRelay number
├─ agentNamestringNot RequiredAgent name
├─ customerRingingTimenumberNot RequiredCustomer ringing duration
├─ talkRecordstringNot RequiredCall recording
├─ outLineNumberstringNot RequiredExternal line number
├─ talkTimenumberNot RequiredCall duration in seconds
├─ followUpCallstringNot RequiredFollow-up call
├─ queueNamestringNot RequiredQueue name
├─ queueResultstringNot RequiredQueue result
├─ ringResultstringNot RequiredRing result
├─ seqRingstringNot RequiredSequential ring
├─ outCallRingTimestringNot RequiredOutbound call ringing duration
├─ outCallDefeatCausestringNot RequiredOutbound call failure reason
├─ hangupBystringNot RequiredHang-up party
├─ callResultstringNot RequiredCall result
├─ agentInfoobjectNot RequiredAgent information
├─ idnumberNot RequiredAgent ID
├─ namestringNot RequiredAgent name
├─ employeeIdstringNot RequiredAgent employee ID
├─ numberstringNot RequiredAgent extension
├─ talkInfoobjectNot RequiredCall information
├─ beginAtstringNot RequiredStart time
├─ endAtstringNot RequiredEnd time
├─ recordstringNot RequiredRecord
├─ talkTimenumberNot RequiredCall duration
├─ hangupBystringNot RequiredHang-up party
├─ numOfAgentHoldnumberNot RequiredNumber of agent holds
├─ numOfAgentSilencestringNot RequiredNumber of agent silences
├─ numOfAgentToIvrnumberNot RequiredNumber of agent transfers to IVR
├─ field_10numOfAgentTransfernumberNot RequiredNumber of agent transfers
├─ numOfAgentAdvisorynumberNot RequiredNumber of agent consultations
├─ numOfAgentThirdnumberNot RequiredNumber of agent three-way calls
├─ agentEventsstring[]Not RequiredAgent call eventsItem type: string
├─Not Required
├─ categorynumberNot RequiredCall type
├─ ivrInfoobjectNot RequiredIVR information
├─ recordstringNot RequiredIVR call recording
├─ variablesstring[]Not RequiredIVR variable listItem type: string
├─Not Required
├─ viewCallVariablesListstring[]Not RequiredIVR variablesItem type: string
├─Not Required
├─ lablesstring[]Not RequiredIVR label listItem type: string
├─Not Required
├─ ivrTimesnumberNot RequiredIVR duration
├─ processobject[]Not RequiredIVR event processItem type: object
├─ seqnumberNot RequiredSequence number
├─ beginAtstringNot RequiredEntry time
├─ endAtstringNot RequiredExit time
├─ ivrNamestringNot RequiredNode name
├─ ivrLogstringNot RequiredNode log
├─ phoneInfoobjectNot RequiredCustomer phone information
├─ numberstringNot RequiredPhone number
├─ provincestringNot RequiredProvince
├─ citystringNot RequiredCity
├─ operatorstringNot RequiredOperator
├─ queueInfoobjectNot RequiredQueue information
├─ enterQueuenumberNot RequiredEntry queue node
├─ enterRulestringNot RequiredEntry queue rule
├─ enterEventstringNot RequiredEntry queue event
├─ repeatCusterRulestringNot RequiredRepeat customer rule
├─ queueTypestringNot RequiredQueue type
├─ queueIdnumberNot RequiredQueue ID
├─ queueNamestringNot RequiredQueue name
├─ customerLevelnumberNot RequiredCustomer level
├─ callLevelnumberNot RequiredCall level
├─ enterAtstringNot RequiredEntry time
├─ queueTimenumberNot RequiredQueue duration
├─ assignAtstringNot RequiredAssignment time
├─ assignRulestringNot RequiredAssignment rule
├─ continuousRingTimenumberNot RequiredContinuous ringing duration
├─ lastAgentRingTimenumberNot RequiredLast agent ringing duration
├─ numOfSeqRingnumberNot RequiredNumber of sequential rings
├─ seqRingEventstringNot RequiredSequential ring event
├─ queueResultstringNot RequiredQueue result
├─ ringResultstringNot RequiredRing result
├─ surveryListstring[]Not RequiredSatisfaction survey informationItem type: string
├─Not Required
├─ messageUrlstringNot RequiredVoicemail
├─ adTaskNamestringNot RequiredAutomatic dialing task name
├─ externFlagstringNot RequiredWhether to transfer to an external line
├─ validFlagstringNot RequiredCall validity (0: no judgment, 1: valid, 2: invalid)
├─ viewCallVariablesListstring[]Not RequiredIVR variablesItem type: string
├─Not Required
├─ allRecordUrlListobject[]Not RequiredAll recordingsItem type: object
├─ recordUrlstringNot RequiredRecording URL
├─ recordTypestringNot RequiredType
├─ totalIvrTimenumberNot RequiredTotal IVR duration

09 Call Details Inquiry

Basic Information

Path: /api/v1/petitions/callId
Method: GET
Interface Description:

Overview

Query Details of Call Record

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/petitions/callId?callId=d44539e0-3d41-4854-83da-d22a0d251304&AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd'
Response
    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed": true,
        "code": 200,
        "bizCode": "000000",
        "message": "OK",
        "visible": false,
        "data": {
            "id": 16938727,
            "callId": "d44539e0-3d41-4854-83da-d22a0d251304",
            "category": 2,
            "customerNumber": "18710180975",
            "beginAt": "2021-06-26 00:09:28",
            "endAt": "2021-06-26 00:09:51",
            "defeatCause": null,
            "displayNumber": "04536341334",
            "agentName": "test ",
            "customerRingingTime": 0,
            "talkRecord": "https://s4-ccps-pri-std.obs.cn-north-4.myhuaweicloud.com/c055e127-95d0-44f0-7564-5f570d410b68/cc_recordings/20210626000945_d44539e0-3d41-4854-83da-d22a0d251304_a5138e4d-5eec-4d5f-bc1d-6cf9c5a0eacf_18710180975.mp3?AWSAccessKeyId=KNERXMMZRQZ7UHV2OSEN&Expires=1656173390&Signature=Pb%2BSiPvi9GtFvLIm98nyJV0CHZE%3D",
            "outLineNumber": "",
            "talkTime": 5,
            "followUpCall": "None",
            "queueName": "test -Queue",
            "queueResult": "Queue Success",
            "ringResult": "agent Answer",
            "seqRing": "0",
            "outCallRingTime": null,
            "outCallDefeatCause": null,
            "hangupBy": "Agent",
            "callResult": "agent Answer",
            "agentInfo": {
                "id": 781,
                "name": "test ",
                "employeeId": "Agent-001",
                "number": "98674238501001"
            },
            "talkInfo": {
                "beginAt": "2021-06-26 00:09:45",
                "endAt": "2021-06-26 00:09:51",
                "record": "https://s4-ccps-pri-std.obs.cn-north-4.myhuaweicloud.com/c055e127-95d0-44f0-7564-5f570d410b68/cc_recordings/20210626000945_d44539e0-3d41-4854-83da-d22a0d251304_a5138e4d-5eec-4d5f-bc1d-6cf9c5a0eacf_18710180975.mp3?AWSAccessKeyId=KNERXMMZRQZ7UHV2OSEN&Expires=1656173390&Signature=Pb%2BSiPvi9GtFvLIm98nyJV0CHZE%3D",
                "talkTime": 5,
                "hangupBy": "Agent",
                "numOfAgentHold": 0,
                "numOfAgentSilence": 0,
                "numOfAgentToIvr": 0,
                "numOfAgentTransfer": 0,
                "numOfAgentAdvisory": 0,
                "numOfAgentThird": 0,
                "agentEvents": [],
                "category": 0
            },
            "ivrInfo": {
                "record": null,
                "variables": null,
                "lables": null,
                "ivrTimes": 30,
                "process": [
                    {
                        "seq": 1,
                        "beginAt": "2021-06-26 00:09:28",
                        "endAt": "2021-06-26 00:09:58",
                        "ivrName": null,
                        "ivrLog": null
                    }
                ]
            },
            "phoneInfo": {
                "number": "18710710970",
                "province": "New York",
                "city": "New York",
                "operator": null
            },
            "queueInfo": {
                "enterQueue": null,
                "enterRule": null,
                "enterEvent": null,
                "repeatCusterRule": "",
                "queueType": "Queue",
                "queueId": 2411,
                "queueName": "test -Queue",
                "customerLevel": null,
                "callLevel": null,
                "enterAt": "2021-06-26 00:09:31",
                "queueTime": 14,
                "assignAt": "2021-06-26 00:09:45",
                "assignRule": null,
                "continuousRingTime": null,
                "lastAgentRingTime": 15,
                "numOfSeqRing": 0,
                "seqRingEvent": null,
                "queueResult": "Queue Success",
                "ringResult": "agent Answer"
            },
            "surveryList": [
                "Evaluated-1-12"
            ]
        }
    }

Request Parameters

Headers

Parameter NameParameter ValueRequiredExampleNotes
Content-Typeapplication/jsonYes

Query

Parameter NameRequiredExampleNotes
callIdYesd44539e0-3d41-4854-83da-d22a0d251304

Response Data

NameTypeRequiredDefaultRemarksAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code. 200 for success
bizCodestringRequiredbizcode
messagestringRequiredMessage
visiblebooleanRequiredvisible
dataobjectNot RequiredResult
├─ idnumberRequiredUnique sequence
├─ callIdstringRequiredCall ID
├─ categorynumberRequiredCall type 1: Outgoing 2: Incoming
├─ customerNumberstringNot RequiredCustomer phone number
├─ beginAtstringRequiredCall time
├─ endAtstringRequiredEnd time
├─ displayNumberstringNot RequiredRelay number
├─ agentNamestringNot RequiredAgent name
├─ customerRingingTimenumberNot RequiredCustomer ringing duration
├─ talkRecordstringNot RequiredCall recording
├─ outLineNumberstringNot RequiredExternal line number
├─ talkTimenumberNot RequiredCall duration in seconds
├─ followUpCallstringNot RequiredFollow-up call
├─ queueNamestringNot RequiredQueue name
├─ queueResultstringNot RequiredQueuing result
├─ ringResultstringNot RequiredRinging result
├─ seqRingstringNot RequiredSequential ring
├─ outCallRingTimestringNot RequiredOutbound ringing duration
├─ outCallDefeatCausestringNot RequiredOutbound failure reason
├─ hangupBystringNot RequiredHang-up party
├─ callResultstringNot RequiredCall result
├─ agentInfoobjectNot RequiredAgent information
├─ idnumberNot RequiredAgent ID
├─ namestringNot RequiredAgent name
├─ employeeIdstringNot RequiredAgent employee ID
├─ numberstringNot RequiredAgent extension
├─ talkInfoobjectNot RequiredCall information
├─ beginAtstringNot RequiredCall start time, format: yyyy-mm-dd HH:mm:ss
├─ endAtstringNot RequiredCall end time
├─ recordstringNot RequiredCall recording
├─ talkTimenumberNot RequiredCall duration
├─ hangupBystringNot RequiredHang-up party
├─ numOfAgentHoldnumberNot RequiredNumber of agent holds
├─ numOfAgentSilencenumberNot RequiredNumber of agent silences
├─ numOfAgentToIvrnumberNot RequiredNumber of agent transfers to IVR
├─ numOfAgentTransfernumberNot RequiredNumber of agent transfers
├─ numOfAgentAdvisorynumberNot RequiredNumber of agent consultations
├─ numOfAgentThirdnumberNot RequiredNumber of agent three-party calls
├─ agentEventsstring[]Not RequiredAgent call eventsItem type: string
├─Not RequiredAgent event
├─ ivrInfoobjectNot RequiredCall IVR information
├─ recordstringNot RequiredIVR call recording
├─ variablesstring[]Not RequiredCall record variable collectionItem type: string
├─Not RequiredVariable
├─ labelsstring[]Not RequiredCall record label collectionItem type: string
├─Not RequiredLabel
├─ ivrTimesnumberNot RequiredIVR dwell time
├─ processobjectNot RequiredIVR event process
├─ beginAtstringNot RequiredIVR start time, format: yyyy-MM-dd HH:mm:ss
├─ endAtstringNot RequiredIVR end time, same format as above
├─ ivrNamestringNot RequiredVR name
├─ ivrLogstringNot RequiredIVR log
├─ phoneInfoobjectNot Required
├─ numberstringNot RequiredNumber
├─ provincestringNot RequiredProvince
├─ citystringNot RequiredCity
├─ operatorstringNot RequiredOperator
queueInfoobjectNot Required
├─ enterQueuenumberNot RequiredEnter queue node
├─ enterRulestringNot RequiredEnter queue rule
├─ enterEventstringNot RequiredEnter queue event
├─ repeatCusterRulestringNot RequiredRepeat customer rule
├─ queueTypestringNot RequiredQueue type
├─ queueIdnumberNot RequiredQueue ID
├─ queueNamestringNot RequiredQueue name
├─ customerLevelnumberNot RequiredCustomer level
├─ callLevelnumberNot RequiredCall level
├─ enterAtstringNot RequiredEnter queue time
├─ queueTimenumberNot RequiredQueue duration
├─ assignAtstringNot RequiredAssignment time
├─ assignRulestringNot RequiredAssignment rule
├─ continuousRingTimenumberNot RequiredContinuous ringing duration
├─ lastAgentRingTimenumberNot RequiredLast agent ringing duration
├─ numOfSeqRingnumberNot RequiredNumber of sequential rings
├─ seqRingEventstringNot RequiredSequential ring event
├─ queueResultstringNot RequiredQueue result
├─ ringResultstringNot RequiredRing result
├─ surveryListstring[]Not RequiredSatisfaction survey informationItem type: string
├─Not RequiredDetailed satisfaction survey data
├─ messageUrlstringNot RequiredVoicemail
├─ adTaskNamestringNot RequiredAutomatic call task name
├─ externFlagstringNot RequiredWhether to transfer to an external line
├─ validFlagstringNot RequiredCall validity, 0: no judgment, 1: valid, 2: invalid
├─ viewCallVariablesListstring[]Not RequiredIVR variablesItem type: string
├─Not Required
├─ allRecordUrlListobject[]Not RequiredAll recordingsItem type: object
├─ recordUrlstringNot RequiredRecording URL
├─ recordTypestringNot RequiredType
├─ totalIvrTimenumberNot RequiredTotal IVR duration

10 Add Restricted Numbers

Basic Information

Path: /api/v1/calllimit/{callType}/numbers
Method: POST
Interface Description:

Overview

Adding Restricted Call Numbers

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/calllimit/in/numbers?AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X POST -H 'Content-Type: application/json'  -d '{
    	"numberInputModel": 1,
    	"numbers": [
    		"17000000000"
    	],
    	"limitType": "forever"
    }'

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed": true,
        "code": 200,
        "bizCode": "000000",
        "message": "OK",
        "visible": false,
        "data": {
            "totalSize": 1,
            "repeatSize": 1,
            "repeatList": [
                "17000000000"
            ]
        }
    }

Request Parameters

Headers

Parameter NameParameter ValueMandatoryExampleNotes
Content-Typeapplication/jsonYes

Path Parameters

Parameter NameExampleNotes
callTypeinCall type: in - incoming, out - outgoing

Body

NameTypeMandatoryDefaultNotesAdditional Info
numberInputModelnumberRequiredNumber input method, default to 1
numbersstring[]RequiredArray of numbersItem Type: string
├─OptionalIndividual number
limitTypestringRequiredType of limit: forever (permanent), minute, hour, day, week, month, year
limitTimenumberOptionalDuration of the limit (required if limitType is not 'forever')
limitReasonstringOptionalReason for the limit

Response Data

NameTypeRequiredDefaultRemarksAdditional Information
succeedbooleanNot RequiredSuccess flag
codenumberNot RequiredResult code
bizCodestringNot Requiredbizcode
messagestringNot RequiredMessage
visiblebooleanNot RequiredVisibility
dataobjectRequired
├─ totalSizenumberRequiredTotal count
├─ repeatSizenumberRequiredNumber of duplicates in the database
├─ repeatListstring[]RequiredDuplicate setItem type: string
├─Not RequiredDuplicate number

11 Call Number Inquiry for Call Restrictions

Basic Information

Path: /api/v1/calllimit/{callType}/numbers/search
Method: GET
Interface Description:

Overview

Query for restricted call numbers with support for pagination.

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/calllimit/{callType}/numbers/search?AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd&pageNum=1&pageSize=20'

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed": true,
        "code": 200,
        "bizCode": "000000",
        "message": "OK",
        "visible": false,
        "paging": {
            "pageNum": 1,
            "pageSize": 20,
            "total": 1
        },
        "data": [
            {
                "id": 100,
                "number": "18710180977",
                "numberInputModel": 1,
                "limitType": "foever",
                "limitTime": null,
                "unlimitTime": null,
                "limitReason": null,
                "createdAt": "2021-07-17 19:11:16",
                "updatedAt": "2021-07-17 19:11:20",
                "createdUserId": null,
                "updatedUserId": null
            }
        ]
    }

Request Parameters

Path Parameters

Parameter NameExampleRemarks
callTypeinin: Incoming call out: Outgoing call

Query

Parameter NameRequiredExampleRemarks
pageNumNo1Page number
pageSizeNo20Rows per page
keywordNo1871018Keyword (number), supports fuzzy search

Response Data

NameTypeRequiredDefaultRemarksAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code
bizCodestringRequiredbizCode
messagestringRequiredMessage
visiblebooleanRequiredVisibility
pagingobjectRequiredPaging information
├─ pageNumnumberRequiredPage number
├─ pageSizenumberRequiredRows per page
├─ totalnumberRequiredTotal count
dataobject[]RequiredRestricted number dataItem type: object
├─ idnumberRequiredUnique identifier
├─ numberstringRequiredNumber
├─ createdAtstringRequiredCreation time
├─ limitTypestringRequiredLimit type: Forever - forever, Minute - minute, Hour - hour, Day - day, Week - week, Month - month, Year - year
├─ unlimitTimestringOptionalTime to lift the restriction
├─ limitReasonstringRequiredReason for the restriction

12 Get Phone Number Details by Mobile Number

Basic Information

Path: /api/v1/calllimit/{callType}/tel/{number}
Method: GET
Interface Description:

Overview

Retrieve the details of a phone number by the mobile number.

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/calllimit/in/tel/17000000000?AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd'

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed": true,
        "code": 200,
        "bizCode": "000000",
        "message": "OK",
        "visible": false,
        "data": {
            "id": 100,
            "number": "17000000000",
            "numberInputModel": 1,
            "limitType": "forever",
            "limitTime": null,
            "unlimitTime": null,
            "limitReason": null,
            "createdAt": "2021-07-17 19:11:16",
            "updatedAt": "2021-07-17 19:11:20",
            "createdUserId": null,
            "updatedUserId": null
        }
    }

Request Parameters

Path Parameters

Parameter NameExampleRemarks
callTypeinCall type: in - incoming, out - outgoing
number17000000000Phone number

Response Data

NameTypeRequiredDefaultNotesAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code
bizCodestringRequiredbizCode
messagestringRequiredMessage
visiblebooleanRequiredVisibility
dataobjectRequiredData
├─ idnumberRequiredUnique identifier
├─ numberstringRequiredNumber
├─ numberInputModelnumberRequiredNumber input mode 1:Manual input 2:Batch import 3:Regex input
├─ limitTypestringRequiredLimit type Permanent:forever Minute:minute Hour:hour Day:day Week:week Month:month Year:year
├─ limitTimenumberRequiredLimit duration
├─ unlimitTimestringRequiredTime to lift the limit
├─ limitReasonstringRequiredReason for the limit
├─ createdAtstringRequiredCreation time
├─ updateAtstringRequiredUpdate time
├─ createdUserIdstringRequiredCreator
├─ updateUserIdstringRequiredUpdater

13 Modify Restricted Number Information by Phone Number

Basic Information

Path: /api/v1/calllimit/{callType}/tel/{number}
Method: PUT
Interface Description:

Overview

Modify restricted number information via mobile phone number

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/calllimit/in/tel/17000000000?AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X PUT -H 'Content-Type: application/json'  -d '{
        "limitType": "day",
        "limitTime": 1,
        "limitReason":"testing"
    }'

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed": true,
        "code": 200,
        "bizCode": "000000",
        "message": "OK",
        "visible": false,
        "data": {
            "number": "17000000000",
            "limitType": "day",
            "limitTime": 1,
            "limitReason": "testing"
        }
    }

Request Parameters

Headers

Parameter NameParameter ValueRequiredExampleNotes
Content-Typeapplication/jsonYes

Path Parameters

Parameter NameExampleNotes
callTypeinCall type: in for inbound, out for outbound
number17000000000The phone number

Body

NameTypeRequiredDefaultRemarksAdditional Information
limitTypestringRequired-Type of Limit: forever, minute, hour, day, week, month, year-
limitTimenumberOptional-Duration of the Limit-
limitReasonstringOptional-Reason for the Limit-

Response Data

NameTypeRequiredDefaultRemarksAdditional Information
succeedbooleanNot RequiredSuccess flag
codenumberNot RequiredResult code
bizCodestringNot Requiredbizcode
messagestringNot RequiredMessage
visiblebooleanNot RequiredVisibility
dataobjectNot Required
├─ numberstringNot RequiredNumber
├─ limitTypestringNot RequiredLimit type: Permanent - forever, Minute - minute, Hour - hour, Day - day, Week - week, Month - month, Year - year
├─ limitTimenumberNot RequiredLimit duration
├─ limitReasonstringNot RequiredReason for the limit

14 Delete Restricted Number Information by Phone Number

Basic Information

Path: /api/v1/calllimit/{callType}/tel/{number}
Method: DELETE
Interface Description:

Overview

Remove restricted number information by phone number

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/calllimit/in/tel/17000000000?AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X DELETE

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed": true,
        "code": 200,
        "bizCode": "000000",
        "message": "OK",
        "visible": false
    }

Request Parameters

Headers

Parameter NameParameter ValueRequiredExampleNotes
Content-Typeapplication/x-www-form-urlencodedYes

Path Parameters

Parameter NameExampleNotes
callTypeinCall type: in for incoming, out for outgoing
number18920765652Number ID

Response Data

NameTypeRequiredDefaultNotesAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code
bizCodestringRequiredbizCode
messagestringRequiredMessage
visiblebooleanRequiredVisibility

15 Batch Delete Restricted Numbers by Phone

Basic Information

Path: /api/v1/calllimit/{callType}/tel/batch-delete
Method: PUT
Interface Description:

Overview

Batch delete restricted numbers by phone number

Example

Request

    $ curl 'https://demo.udesk.cn/api/v1/calllimit/in/tel/batch-delete?AppId=1234567890abc&Timestamp=1496631984&Token=4c1947cb3d87743b613f3a4843ae74306529d4fd' -i -X PUT -H 'Content-Type: application/json'  -d  '{
        "numbers": [
    	    "17000000000"
        ]
    }'

Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: 522
    
    {
        "succeed": true,
        "code": 200,
        "bizCode": "000000",
        "message": "OK",
        "visible": false
    }

Request Parameters

Headers

Parameter NameParameter ValueMandatoryExampleNotes
Content-Typeapplication/jsonYes

Path Parameters

Parameter NameExampleNotes
callTypeinCall type "in": inbound, "out": outbound

Body

NameTypeRequiredDefaultRemarksAdditional Information
numbersstring[]RequiredMultiple number IDsItem Type: string
├─Not RequiredNumber

Response Data

NameTypeRequiredDefaultNotesAdditional Information
succeedbooleanRequiredSuccess flag
codenumberRequiredResult code
bizCodestringRequiredbizCode
messagestringRequiredMessage
visiblebooleanRequiredVisibility