Add a 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 NameDescriptionData Type
name*Name for departmentString
description*Description for departmentString
ring_strategy*order in which calls will be received by agentsString
timeout_dest_type*when no agent answers the call, it is forwarded to this type of destinationString
timeout_destination*Unique ID of the destination where call will be the transferred when no agent in department answers the callInteger
timeout*time for which call will ring for each agentArray of strings
destination*Unique ID of agentArray of strings
music_on_holdUnique ID of music on hold to be played when caller is on holdInteger
sticky_agentThe agent who will receive the calls in a department, if enabled. For example, 05047530211.Integer

Allowed ring strategies

simultaneousCalls will ring one after the other
order_byCalls will ring in an order or sequence in which agents are added
randomCalls ring agents in random order
round_robinRound 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 NameDescriptionType
enableIndicates wether sticky agent be enabled or disabled.
1 - Enable
0 - Disable
timetime 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

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 NameDescriptionData Type
successRequest success statusBoolean
messageMessage corresponding success statusString
Click Try It! to start a request and see the response here!