Create Presence Subscription

Create a subscription to receive events on any update to users presence.

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

Request URL

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

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.

Parameters

NameTypeDescription
model
requiredbody
string

Must be "presence". This will update on presence and status message updates.

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
optionalbody
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 --location --request POST 'https://uc.hopdial.com/ns-api/?object=event&action=create' \
--header 'Authorization: Bearer 06ceda673236fc567acf6f1322fc8870' \
--form 'model=presence' \
--form 'post_url=https://www.acmecorp.com/callback/presencelistener' \
--form 'expires=2040-05-08+00:00' \
--form 'domain=acmecorp.12345.service'

Responses

200 · application/xml
<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <Subscription>
        <model>presence</model>
        <scope>Office Manager</scope>
        <territory>12345</territory>
        <domain>acmecorp.12345.service</domain>
        <user>*</user>
        <post_url>https://www.acmecorp.com/callback/presencelistener</post_url>
        <owner_uid>[email protected]</owner_uid>
        <expires>2040-05-08 00:00:00</expires>
        <subscription_id>859ac5cb78df917849f7b2d9f17fff40</subscription_id>
    </Subscription>
</xml
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.