Updated on 2023-09-27 GMT+08:00

Creating an Anonymous Call (createcall)

Scenario

An operator logs in to the app and invokes the createcall interface provided by the chat module to create an anonymous outbound call task. Then, the operator can initiate an anonymous call by integrating the SDK.

Method

POST

URI

https://Domain name/apiaccess/ccmessaging/v1/mobileagent/createcall (For example, the domain name is service.besclouds.com.)

Request Description

Table 1 Request header parameters

No.

Parameter

Type

Mandatory or Not

Description

1

X-APP-Key

String

Yes

App key, which is the user ID

2

Authorization

String

Yes

Authentication field. The format is Bearer {Value of AccessToken returned by the tokenByAkSk interface}. (A space is required after Bearer.)

Table 2 Request body parameters

No.

Parameter

Type

Mandatory or Not

Description

1.1

called

String (32)

Yes

Called number

1.2

callData

String (1024)

No

Call data

1.3

callerPresent

String (32)

Yes

Calling number displayed to users and customer managers. If this parameter is not included, the calling number of the platform is used by default.

Response Description

  • Status code: 200
Table 3 Response body parameters

No.

Parameter

Type

Mandatory or Not

Description

1.1

resultCode

String

Yes

Return code.

The value 0 indicates success, and other values indicate failure.

30010000001: The feature is not enabled and cannot be used.

30010000002: No SIP server information is found.

30010000003: Input parameter verification failed.

30010010001: failure to add an outbound call task.

30010010002: The VDN is unavailable.

30010010003: The VDN configuration is abnormal, and the recording path fails to be generated.

30010019999: Other CCM exceptions occur.

30011010001: The call fails to be created because the call setup success event is not received.

30011019999: Other CCUCS exceptions occur.

30010009999: The chat module is abnormal.

1.2

resultDesc

String

No

Failure cause.

1.3

resultData

Object

No

Response structure.

1.3.1

callSerialNo

String (50)

No

Call SN.

1.3.2

sipServiceAddress

String

Yes

SIP server address, which is in the format of IP address:Port number.

1.3.3

accesscode

String

Yes

This parameter is used for VoIP anonymous calls. The format is {Access code}{UVID}.

  • Status code: 400

    Incorrect request. Check the request path and parameters.

  • Status code: 401

    Unauthorized operation. 1. Check whether you have purchased related services. 2. Contact customer service to check the status of your account.

  • Status code: 404

    The requested content is not found. Check the request path.

  • Status code: 500

    Business failure. Check the values of parameters in the request.

Error Codes

None

Example

  • Scenario: Create an outbound call task.
  • Request header
    {
    	"X-APP-Key": "b*************c7b",
    	"Authorization": "Bearer 1fea*************1d6a15",
    	"Content-Type": "application/json"
    }
  • Request parameters
    {
    	"called": "88884432",
    	"callData": "1",
    	"callerPresent": "95599"
    }
  • Response header
    connection: keep-alive  
    content-encoding: gzip  
    content-length: 130 
    content-type: application/json;charset=UTF-8  
    date: Wed, 12 May 2021 08:52:40 GMT  
    server: openresty
  • Response parameters
    {
    	"resultCode": "0",
    	"resultDesc": "Success",
    	"resultData": {
    		"sipServiceAddress": "10.137.203.215:5063",
    		"accesscode": "179080024609291"
    	}
    }