Create Agent Subscription
Create a subscription to receive events on any update to a call queue (hunt group) agent.
/?object=event&action=create&model=agentRequest URL
https://uc.hopdial.com/ns-api/?object=event&action=create&model=agentSend 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
| Parameters | Description |
|---|---|
| device_aor | SIP URI of device in Hunt group |
| huntgroup_name | The name of the hunt group. This will match the name of a queue as well. |
| huntgroup_domain | Domain of the Hunt group |
| entry_option | Behavior 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_sec | Time after a call where agent will not receive another call. |
| auto_ans | Will update SIP headers to tell SIP UA's to automatically answer if they support this feature |
| entry_order | Order In which the hunt group will dispatch calls to it's agents |
| entry_priority | Priority of the agent in the queue. Mostly used for cascading ring groups |
| call_limit | Number of simultaneous calls an agent can take at once |
| confirm_required | When an agent answers, they will be prompted to press 1 to take the call. |
| entry_device | The type of the device |
| entry_status | The status of the agent, "available", "unavailable" |
| owner_user | The Subscriber that owns the device |
| owner_domain | Domain of the agent |
| session_count | Number of current calls agent is handling |
| error_info | Tells if there are any current errors with the agent. |
| last_update | Last time this hunt group was updated. |
Parameters
| Name | Type | Description |
|---|---|---|
modelrequiredbody | string | Must be "agent". This will update when the status of a call center agent changes. |
domainrequiredbody | string | Specify which domain you would like to receive events for. Use * to receive events for all domains. |
userrequiredbody | string | Specify which user to receive events for. Use * to receive for all users |
post_urlrequiredbody | string | HTTP or HTTPS endpoint. This is where HopDial will POST the events |
expiresrequiredbody | 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
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
[
{
"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"
}
]{}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.