Create Agent Subscription

Create a subscription to receive events on any update to a call queue (hunt group) agent.

POST/?object=event&action=create&model=agent

Request URL

POST
https://uc.hopdial.com/ns-api/?object=event&action=create&model=agent

Send your access token in the Authorization: Bearer header. Body parameters are sent as application/x-www-form-urlencoded. New to the API? Start with authentication and rate limits.

Event payload fields

ParametersDescription
device_aorSIP URI of device in Hunt group
huntgroup_nameThe name of the hunt group. This will match the name of a queue as well.
huntgroup_domainDomain of the Hunt group
entry_optionBehavior of the agents availability. "manual" requires additional interaction to make an agent available when unavailable while "immediate" automatically makes the agent available after each call.
wrap_up_secTime after a call where agent will not receive another call.
auto_ansWill update SIP headers to tell SIP UA's to automatically answer if they support this feature
entry_orderOrder In which the hunt group will dispatch calls to it's agents
entry_priorityPriority of the agent in the queue. Mostly used for cascading ring groups
call_limitNumber of simultaneous calls an agent can take at once
confirm_requiredWhen an agent answers, they will be prompted to press 1 to take the call.
entry_deviceThe type of the device
entry_statusThe status of the agent, "available", "unavailable"
owner_userThe Subscriber that owns the device
owner_domainDomain of the agent
session_countNumber of current calls agent is handling
error_infoTells if there are any current errors with the agent.
last_updateLast time this hunt group was updated.

Parameters

NameTypeDescription
model
requiredbody
string

Must be "agent". This will update when the status of a call center agent changes.

domain
requiredbody
string

Specify which domain you would like to receive events for. Use * to receive events for all domains.

user
requiredbody
string

Specify which user to receive events for. Use * to receive for all users

post_url
requiredbody
string

HTTP or HTTPS endpoint. This is where HopDial will POST the events

expires
requiredbody
string (date)

Specifies when the subscription will expire. (Set date a couple days in the future as server time calculates the expiration incorrectly)

Example request

text
curl https://uc.hopdial.com/ns-api/ \
   -H 'Authorization: Bearer 7bet078rqljh451l31uh34lsd0f80dsf' \
   -d object='event' \
   -d model='agent' \
   -d action='create' \
   -d domain='abc-company.11111.service' \
   -d user='*' \
   -d post_url='https://events.example.com/agents'
   -d expires='2016-11-20 00:00:00'

Responses

200 · application/json
[  
  {  
    "device_aor":"sip:[email protected]",
    "huntgroup_name":"9000",
    "huntgroup_domain":"abc.11111.service",
    "entry_option":"manual",
    "wrap_up_sec":"0",
    "auto_ans":"no",
    "entry_order":4,
    "entry_priority":4,
    "call_limit":"1",
    "confirm_required":"no",
    "entry_device":"reg",
    "entry_status":"unavailable",
    "owner_user":"",
    "owner_domain":"",
    "session_count":1,
    "error_info":"",
    "last_update":"2016-04-06T15:39:42.000Z"
  },
  {  
    "device_aor":"sip:[email protected]",
    "huntgroup_name":"8011",
    "huntgroup_domain":"abc.11111.service",
    "entry_option":"manual",
    "wrap_up_sec":"0",
    "auto_ans":"no",
    "entry_order":1,
    "entry_priority":10,
    "call_limit":"1",
    "confirm_required":"no",
    "entry_device":"reg",
    "entry_status":"unavailable",
    "owner_user":"",
    "owner_domain":"",
    "session_count":1,
    "error_info":"",
    "last_update":"2016-04-06T15:39:42.000Z"
  }
]
400 · application/json
{}

More Subscriptions endpoints

Webhooks: get call, CDR, recording, presence, agent, and audit events POSTed to your own URL.

Need a Client ID and Client Secret or help with this endpoint? Contact HopDial support or call (866) 305-0407.