v1/telephony/autoCallThis method allows you to create a new auto-call task. Upon successful request execution, the identifier of the created task will be returned.
The task start time depends on the
startTypeparameter.
curl --location 'https://twin24.ai/cis/api/v1/telephony/autoCall' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer TOKEN' \
--data '{
"name": "test_autocall",
"taskComment": "API test call task",
"startType": "time",
"startMoment": "2023-06-02 10:00",
"scheduleId": "bce7d22e-dde6-4427-b391-ebbdfda44de6",
"defaultExec": "robot",
"defaultExecData": "228cc4fa-92f2-4709-94e3-7344a96a5903",
"secondExec": "ch",
"secondExecData": "48a77bd7-8762-4e0f-a277-4ef77e36c41b",
"cidType": "gornum",
"cidData": "9a67dee5-398e-4570-9426-fbb3f067b270",
"callStrategy": "STEP_2_STEP",
"cps": 1.03,
"checkPhone": true,
"sendReportAfterFinish": true,
"webhookUrls": [
{
"url": "https://example.com",
"partialResults": true,
"delay": 4,
"events": {
"CALL_ENDED": {
"name": "CALL_ENDED",
"value": true
},
"CANDIDATE_CHANGED": {
"name": "CANDIDATE_CHANGED",
"value": true
},
"CALL_REDIRECTED": {
"name": "CALL_REDIRECTED",
"value": true
},
"RECALL_SCHEDULED": {
"name": "RECALL_SCHEDULED",
"value": true
},
"EFFICIENCY_REACHED": {
"name": "EFFICIENCY_REACHED",
"value": true
},
"AUTOCALL_STATUS_CHANGED": {
"name": "AUTOCALL_STATUS_CHANGED",
"value": true
}
}
}
],
"additionalOptions": {
"fullListMethod": "reject",
"fullListTime": 0,
"allowCallTimeFrom": 0,
"allowCallTimeTo": 86399,
"recordCall": true,
"recTrimLeft": 0,
"useTr": false,
"detectRobot": true,
"detectRobotMode": "back",
"detectRobotGreeting": "bce7d22e-dde6-4427-b391-ebbdfda44de6"
},
"redialStrategyOptions": {
"redialStrategyEn": false,
"candidateLimit": {
"redial": false,
"count": 0
},
"numberLimit": {
"redial": false,
"count": 0
},
"busy": {
"redial": false,
"time": 1,
"count": 1
},
"noAnswer": {
"redial": false,
"time": 1,
"count": 1
},
"answerMash": {
"redial": false,
"time": 1,
"count": 1
},
"congestion": {
"redial": false,
"time": 1,
"count": 1
},
"answerNoList": {
"redial": false,
"time": 1,
"count": 1
}
}
}'
{
"name": "test_autocall",
"taskComment": "API test call task",
"startType": "time",
"startMoment": "2023-06-02 10:00",
"scheduleId": "bce7d22e-dde6-4427-b391-ebbdfda44de6",
"defaultExec": "robot",
"defaultExecData": "228cc4fa-92f2-4709-94e3-7344a96a5903",
"secondExec": "ch",
"secondExecData": "48a77bd7-8762-4e0f-a277-4ef77e36c41b",
"cidType": "gornum",
"cidData": "9a67dee5-398e-4570-9426-fbb3f067b270",
"callStrategy": "STEP_2_STEP",
"cps": 1.03,
"checkPhone": true,
"sendReportAfterFinish": true,
"webhookUrls": [
{
"url": "https://example.com",
"partialResults": true,
"delay": 4,
"events": {
"CALL_ENDED": {
"name": "CALL_ENDED",
"value": true
},
"CANDIDATE_CHANGED": {
"name": "CANDIDATE_CHANGED",
"value": true
},
"CALL_REDIRECTED": {
"name": "CALL_REDIRECTED",
"value": true
},
"RECALL_SCHEDULED": {
"name": "RECALL_SCHEDULED",
"value": true
},
"EFFICIENCY_REACHED": {
"name": "EFFICIENCY_REACHED",
"value": true
},
"AUTOCALL_STATUS_CHANGED": {
"name": "AUTOCALL_STATUS_CHANGED",
"value": true
}
}
}
],
"additionalOptions": {
"fullListMethod": "reject",
"fullListTime": 0,
"allowCallTimeFrom": 0,
"allowCallTimeTo": 86399,
"recordCall": true,
"recTrimLeft": 0,
"useTr": false,
"detectRobot": true,
"detectRobotMode": "back",
"detectRobotGreeting": "bce7d22e-dde6-4427-b391-ebbdfda44de6"
},
"redialStrategyOptions": {
"redialStrategyEn": false,
"candidateLimit": {
"redial": false,
"count": 0
},
"numberLimit": {
"redial": false,
"count": 0
},
"busy": {
"redial": false,
"time": 1,
"count": 1
},
"noAnswer": {
"redial": false,
"time": 1,
"count": 1
},
"answerMash": {
"redial": false,
"time": 1,
"count": 1
},
"congestion": {
"redial": false,
"time": 1,
"count": 1
},
"answerNoList": {
"redial": false,
"time": 1,
"count": 1
}
}
}
| Name | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Task name. |
defaultExec |
string | Yes | Always takes the value robot. |
defaultExecData |
string | Yes | Bot script ID to use in the call. |
secondExec |
string | Yes | Action on forwarding: (end (End call), ignore (Do nothing), ch (Forward to channel)). |
secondExecData |
string | Yes, if secondExec = ch |
Channel ID for transfer. |
cidType |
string | Yes | Identifiable number: (default (Default for trunk), gornum (Single number), pool (Group of numbers)). |
cidData |
string | Yes, if cidType = gornum or pool |
Entity ID in cidType. |
callStrategy |
string | Нет | STEP_2_STEP – a sequential strategy; for a candidate with multiple phone numbers, all attempts are first made to call the first number, then all attempts are made to call the next number, and so on. PARALLEL – parallel strategy; for a candidate with multiple numbers, if the first number cannot be reached, the next call will be made to the second number, and so on. After that, a callback queue will be formed. For the parallel strategy to work correctly for multiple candidates, the task’s CPS must be greater than 1. |
startType |
string | Yes | Start mode: (manual (Manual), time (At a specified time)). |
startMoment |
string | Yes, if startType = time |
Start date and time of the call task (YYYY-MM-DD HH:MM). |
scheduleId |
string | No | ID of aq call schedule. |
cps |
float | Yes | Call task intensity. Calculated as 1 + N / 100 for N calls per second (example: N = 3, then CPS = 1.03), or as 1 - N / 100 for 1 call every N seconds (example: N = 60, then CPS = 0.4). |
checkPhone |
boolean | No | Checks if a number is entered correctly. |
taskComment |
string | No | Comment on the task. |
webhookUrls |
Array[Object] | No | An array uf URLs to send call task data to. |
→ url |
string | No | URL to receive webhooks. |
→ partialResults |
boolean | No | Whether to aens intermediate results. |
→ delay |
int | No | Delay before sending a webhook. |
→ events |
Object | No | List of events, which will send webhooks. |
→→ EVENT |
Object | No | Event object. Available events (substituted for EVENT): - CALL_ENDED – call ended - CANDIDATE_CHANGED – candidate status changed - CALL_REDIRECTED – call transferred to an operator - RECALL_SCHEDULED – a callback for the candidate was forcibly scheduled - EFFICIENCY_REACHED – call success status has been forcibly set - AUTOCALL_STATUS_CHANGED – call task status has changed You can learn more about webhooks and events in separate articles: - Webhook for outbound and inbound calls |
→→→ name |
string | No | Name of same as EVENT. |
→→→ value |
boolean | No | Whether to send data about this event. |
lifetime |
integer | No | Task lifetime in seconds. After this time expires, the task is set to HALTED status. If this field is left blank, the task can run indefinitely. |
additionalOptions |
Object | Yes | Additional call parameters. |
→ fullListMethod |
string | Yes | Whether to consider the call successful. Always takes the value reject. |
→ fullListTime |
int | Yes | The number of seconds after which a call is considered successful. |
→ useTr |
boolean | No | Whether to take the recipient's time into account |
→ allowCallTimeFrom |
int | Yes, if useTr = true |
Start of the call-available interval. Specified in seconds. |
→ allowCallTimeTo |
int | Yes, if useTr = true |
End of the call-available interval. Specified in seconds. |
→ recordCall |
boolean | Yes | Whether or not to record calls. |
→ recTrimLeft |
int | Yes, if recordCall = true |
How much to trim from the beginning of the recording. Set in seconds. |
→ detectRobot |
boolean | No | Enable human/robot detection system. |
→ detectRobotMode |
string | Yes, if detectRobot = true |
Human/robot detection mode: (back (Background), block (Blocking)). |
→ detectRobotGreeting |
string | Yes, if detectRobotMode = block |
ID of an audio file, which will play at the start of a call when block detection mode is enabled. |
→ providerId |
string | No | Trunk UUID. Relevant only when using a custom trunk. |
phoneNormalization |
string | No | Determines whether normalization is enabled: (null (disabled), RU (normalization to RU phone number format)). |
normalizationErrorAction |
string | No | Specifies the action to take when a normalization error occurs: (IGNORE_NORMALIZATION_ERROR (skip the number that caused the error), SET_NORMALIZATION_ERROR_FLAG (add the number, marking it as unnormalizable)) . Normalization must be enabled for this parameter. Detailed information about normalization is provided below. |
sendReportAfterFinish |
boolean | No | Whether to send a report to an email. |
redialStrategyOptions |
Object | Yes | Redial rule settings. |
→ redialStrategyEn |
boolean | Yes | Whether to use redial rules. |
→ candidateLimit |
Object | No | Maximum number of calls to a candidate. |
→ numberLimit |
Object | No | Maximum number of calls per number. |
→ → redial |
boolean | Yes | Whether to enable the limit on the maximum number of calls. |
→ → count |
int | Yes, if redial = true |
Maximum number of calls. |
→ busy |
Object | Yes | Redial rule when the status is Busy. |
→ noAnswer |
Object | Yes | Callback rule for the No Answer status. |
→ answerMash |
Object | Yes | Callback rule for the Answering Machine status. |
→ congestion |
Object | Yes | Redial rule for Call error status. |
→ answerNoList |
Object | Yes | Redial rule if call is unsuccessful. |
→ → redial |
boolean | Yes | Whether to activate the redial rule. |
→ → time |
int | Yes, if redial = true |
Delay before redial. Specified in seconds. |
→ → count |
int | Yes, if redial = true |
Number of redials. |
{
"id": {
"identity": "bce7d22e-dde6-4427-b391-ebbdfda44de6"
}
}
Description of response fields:
| Name | Type | Required | Description |
|---|---|---|---|
id |
object | Yes | Task identifier. |
identity |
string | Yes | Unique call ID. |