Click2CallCheckCallWindow¶
GET click2call/callWindow/check
Answers whether a number can be called right now, and shows the local time it was judged by. The CRM uses it to disable the call button with an explanation instead of letting the manager discover the restriction from an error.
The verdict is produced by the same code path that Click2CallStartCall uses, so the two cannot disagree.
Access Control¶
Allowed roles: admin, leader, manager.
Request¶
GET request
GET https://{broker_domain}/click2call/callWindow/check?phone=+380671234567
Authorization: <JWT_TOKEN>
{
"command": "Click2CallCheckCallWindow",
"extID": "1",
"data": {
"phone": "+380671234567"
}
}
const res = await platform.Click2CallCheckCallWindow({
phone: "+380671234567"
});
Request Data¶
| Field | Type | Required | Description |
|---|---|---|---|
phone |
string | Yes | Number in any human format |
Response Data¶
Reasons: OUTSIDE_CALLING_HOURS, OUTSIDE_CALLING_DAYS, WINDOW_NOT_CONFIGURED, NO_WINDOW_CONFIGURED. The last two allow the call — they say the module had nothing to check, not that the call is forbidden.
{
"phone": "+380671234567",
"country": { "iso": "UA", "name": "Ukraine", "dialCode": "380" },
"windowId": 6,
"allowed": false,
"reason": "OUTSIDE_CALLING_HOURS",
"timezone": "Europe/Kyiv",
"localTime": "22:14",
"weekday": 1,
"window": "09:00–20:00"
}
Errors¶
| Code | Error | Description |
|---|---|---|
400 |
VALIDATION_ERROR |
Number is too short to be a phone number |