Create a new department

Using the below method a new department can be created

curl --request POST \
  --url https://api.servetel.in/v1/department \
  --header 'accept: application/json' \
  --header 'authorization: Bearer yourtokenhere' \
  --header 'content-type: application/json' \
  --data '{}'

Request variables

Variable Name

Description

Data Type

name*

Name for department

String

description*

Description for department

String

ring_strategy*

order in which calls will be received by agents

String

timeout_dest_type*

when no agent answers the call, it is forwarded to this type of destination

String

timeout_destination*

Unique ID of the destination where call will be the transferred when no agent in department answers the call

Integer

timeout*

time for which call will ring for each agent

Array of strings

destination*

Unique ID of agent

Array of strings

music_on_hold

Unique ID of music on hold to be played when caller is on hold

Integer

sticky_agent

The agent who will receive the calls in a department, if enabled. For example, 05047530211.

Integer

Allowed ring strategies

Name

Description

simultaneous

Calls will ring one after the other

order_by

Calls will ring in an order or sequence in which agents are added

random

Calls ring agents in random order

round_robin

Round Robin with memory, remember where we left off last ring pass

Request Variables (Body Params)(Sticky Agent)

The Sticky agent connects the caller to the same agent when the user calls within the same threshold time.

Variable Name

Description

Type

enable

Indicates wether sticky agent be enabled or disabled.
1 - Enable
0 - Disable

Integer

time

time for which sticky agent be checked.
example: 12h, 1d
h - hours
d - days

Note: Sticky Agent can only be enabled for at max 10 days.
Max enable time in hrs:240h
Max enable time in days: 10d

String

Code Sample

{
    "timeout": [
        30    ],
    "destination": [
        "extension||05000000550"    ],
    "name": "Sales Department",
    "description": "Sales Department Description",
    "ring_strategy": "simultaneous",
    "timeout_dest_type": "extension",
    "timeout_destination": "extension||05000000550",
    "sticky_agent": {
        "enable": 1,
        "time": "12h"    }
}

Sample Request

curl --request POST \
  --url https://api.servetel.in/v1/department \
  --header 'accept: application/json' \
  --header 'authorization: Bearer yourtokenhere' \
  --header 'content-type: application/json' \
  --data '{"name":"Test Name","description":"Test Description","ring_strategy":"simultaneous","timeout_dest_type":"extension","timeout_destination":500000000,"timeout":[20],"destination":["extension||050000000"]}'

Response variables

Variable Name

Description

Data Type

success

Request success status

Boolean

message

Message corresponding success status

String