Create Call Recording Subscription
Create a subscription to receive events for any of a user's call recordings. You define a URL that will receive a callback any time a call recording event on the PBX matches the parameters of the subscription.
/?object=event&action=create&model=call_recordingRequest URL
https://uc.hopdial.com/ns-api/?object=event&action=create&model=call_recordingSend 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 Callbacks
Call recordings that match the subscription parameters will result in a HTTP(S) post from the PBX to the post_url defined in the subscription. This post will contain a payload that looks like the example below. Because of the nature of how events are processed, multiple call_recording events can be contained in a single callback. The structure of the post is an array of call recordings.
[
{
"accElm": "sip:[email protected]",
"aor0": "sip:[email protected]",
"aor1": "sip:[email protected]",
"callId": "99999aaa-5555-5555-5555-0022482b9ee7",
"caseId":["[email protected]", "sip:[email protected]"],
"cccId": "1104",
"count0": "11801",
"count1": "11747",
"domain0": "domain.123456.service",
"domain1": "domain.123456.service",
"duration": "276",
"event": "convertDone",
"file0": "2025/01/24/aaa-99999aaa-5555-5555-5555-0022482b9ee7-1104-0.rtp",
"file1": "2025/01/24/aaa-99999aaa-5555-5555-5555-0022482b9ee7-1104-1.rtp",
"file2": "2025/01/24/aaa-99999aaa-5555-5555-5555-0022482b9ee7-1104.wav",
"hostname": "rec-node1.example.net",
"size2": "3775",
"status": "converted",
"territory0": "123456",
"territory1": "123456",
"time": "2025-01-24 15:24:33",
"timeClose": "2025-01-24 15:23:09",
"timeOpen": "2025-01-24 15:18:33",
"uid0": "[email protected]",
"uid1": "[email protected]",
"object": "call_recording",
"action": "update",
"download_url": "https://rec-node1.example.net/licf-storage-v2/api/recording?object=recording&action=play&accel=sip%3Asystem%40pbx-node1.example.net&casid=111%40domain.123456.service%3Bsip%3A111t%40domain.123456&cccid=1104&calid=99999aaa-5555-5555-5555-0022482b9ee7&uid=rec-node1.example.net&time=20250124152433&auth=123456",
"node_ts_tx": "2025-01-24 15:24:35"
}
]Download Expiration
Please note that the download_url is only valid for 24 hours.
Parameters
| Name | Type | Description |
|---|---|---|
domainrequiredbody | string | Specify which domain you would like to receive events for. Use * to receive 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 |
expiresoptionalbody | 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 --location 'https://uc.hopdial.com/ns-api/' \
--header 'Authorization: Bearer {REDACTED}' \
--form 'object="event"' \
--form 'action="create"' \
--form 'model="call_recording"' \
--form 'domain="acmecorp.12345.service"' \
--form 'post_url="https://www.acmecorp.com/callback/callrecordinglistener"'Responses
<?xml version="1.0" encoding="UTF-8"?>
<xml>
<Subscription>
<model>call_recording</model>
<scope>Office Manager</scope>
<territory>12345</territory>
<domain>acmecorp.12345.service</domain>
<user>*</user>
<post_url>https://www.acmecorp.com/callback/callrecordinglistener</post_url>
<owner_uid>[email protected]</owner_uid>
<expires>2045-01-24 01:01:37</expires>
<subscription_id>55555a55aa555a5aaaa5a5a5aaa555555</subscription_id>
</Subscription>
</xml>{}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.