Create call attempt intervals
Synchronous method to create a new call attempt interval group in Liner. On success, returns the identifier of the created group.
URL and method
POST /v2/call-attempt/create/
Parameters
titlestring
Call attempt group title.
intervalsarray<int>
List of intervals between call attempts in minutes.
isDefaultbooloptional
Whether this interval group is the default one. Default —false.
resetAttemptsEnabledbooloptional
Whether to reset attempts when the customer asks to “call back”. Default —false.
Request example
<?php
$host = 'https://YOUR_LINER_API_HOST';
$token = 'YOUR_API_TOKEN';
$payload = [
'title' => $title,
'intervals' => [$interval, $interval],
'isDefault' => isset($isDefault) ? (bool)$isDefault : false,
'resetAttemptsEnabled' => isset($resetAttemptsEnabled) ? (bool)$resetAttemptsEnabled : false,
];
$ch = curl_init($host . '/v2/call-attempt/create/');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-Api-Key: ' . $token,
],
CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE),
CURLOPT_TIMEOUT => 15,
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($response === false) {
throw new RuntimeException('cURL error: ' . curl_error($ch));
}
curl_close($ch);
echo "HTTP {$httpCode}\n";
echo $response;
const host = "https://YOUR_LINER_API_HOST";
const token = "YOUR_API_TOKEN";
const payload = {
title: title,
intervals: [interval, interval],
isDefault: isDefault ?? false,
resetAttemptsEnabled: resetAttemptsEnabled ?? false
};
const res = await fetch(`${host}/v2/call-attempt/create/`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": token
},
body: JSON.stringify(payload)
});
const data = await res.json();
console.log("HTTP", res.status, data);
Response example
Response structure
| Field | Type | Description |
|---|---|---|
id |
int |
Identifier of the created call attempt interval group. |
Note
The structure of the data field is described above. For the general API response format, see Request schema