Developer Resources

HopDial Phone System API Reference

Connect your HopDial phone service to your CRM, helpdesk, school or practice software, or your own code. Place calls, react to call events in real time, pull call records and recordings, and manage users — all with 71 documented endpoints.

The short version

  • Base URL: https://uc.hopdial.com/ns-api
  • Authentication: OAuth2. Your HopDial Client ID and Client Secret plus a portal username and password return a Bearer token that lasts one hour and can be refreshed.
  • Requests: every call names an object and an action (for example object=call&action=call). Request bodies are form-encoded.
  • Responses: XML by default; add format=json for JSON.
  • Credentials: request a Client ID and Client Secret from HopDial support.

Base URL

https://uc.hopdial.com/ns-api will not resolve by itself. It is the base URL for making API requests: each request adds the object, action and parameters it needs. For example, a click-to-dial request is built like this:

Click-to-call request template
https://uc.hopdial.com/ns-api/?object=call&action=call&callid=&uid=@&origination=&destination=
Example
https://uc.hopdial.com/ns-api/?object=call&action=call&callid=c2c-8f3a91&[email protected]&[email protected]&destination=18005551212

Every request must also carry your access token (see below). Full parameter details are on the Create Call page.

Authentication: getting an access token

Before an application can use the HopDial API it must obtain an access token using the OAuth2 standard. You need a Client ID and Client Secret (issued by HopDial support) together with the username and password of a user who can log in to the HopDial portal. The user’s scope decides what the token can access:

ScopeAccess level
Basic UserRead and modify any data related to the user
Office ManagerRead and modify any data related to the user’s domain (your whole company)

1. Request an access token

Request for access token
curl https://uc.hopdial.com/ns-api/oauth2/token/ \
-d client_id="your-client-id" \
-d client_secret="your-client-secret" \
-d username="111@abc-company" \
-d password="1234" \
-d grant_type="password"
Returned access token
{
  "access_token":"90679e87dc2e6409211e822434122aaf9480",
  "expires_in":3600,
  "scope":"Office Manager",
  "token_type":"Bearer",
  "refresh_token":"c7bf58a0247e02efc6ee4340f01ed629",
  "legacy": false,
  "domain": "abc-company.12345.service",
  "apiversion": "Version: 41.1.0"
}

Multi-factor authentication

If the user has multi-factor authentication enabled, the first request returns the response below instead of a token. Send the request again with the mfa_vendor, mfa_type and access_token from that response plus the authenticator passcode. You do not need to send the username or password again. The second request returns a normal access token.

Response when MFA is enabled
{
  "mfa":"mfa_required",
  "mfa_vendor":"google",
  "mfa_type":"authenticator",
  "access_token":"51fdab21ca330f6b0c88b2a98ex8932s"
  ,"expires_in":3600
  ,"token_type":"Bearer"
  ,"refresh_token":"08da6c024e9b90eafafcfsdf3c5d449"
  ,"client_id":"your-client-id"
}
Second request with authenticator passcode
curl https://uc.hopdial.com/ns-api/oauth2/token/ \
-d client_id="your-client-id" \
-d client_secret="your-client-secret" \
-d ns_id_type="subscriber" \
-d mfa-type="authenticator" \
-d mfa_vendor="google" \
-d access_token="555559999992a98ex8932s" \
-d passcode="000002" \
-d grant_type="mfa"

2. Use the token

Send the token in the Authorization header of every request:

Header
Authorization: Bearer 90679e87dc2e6409211e822434122aaf9480

3. Refresh the token

Tokens expire after 3600 seconds. Use the refresh token to get a new access token without resubmitting the username and password, then use the new token in the Authorization header of later requests.

Request for token refresh
curl --location --request GET 'https://uc.hopdial.com/ns-api/oauth2/token/?grant_type=refresh_token&client_id=your-client-id&client_secret=your-client-secret&refresh_token=c7bf58a025555ee4340f01ed629'

Inspecting a token

Read a token to see its territory, domain, user, scope and expiration.

Inspecting an access token
curl --location --request GET 'https://uc.hopdial.com/ns-api/oauth2/read?format=json' \
--header 'Authorization: Bearer 3b9d3229d70b442e99e0dfa050473d63'
Access token information
{
    "token": "3b9d3229d70b442e99e0dfa050473d63",
    "client_id": "your-client-id",
    "territory": "12345",
    "domain": "abc-company.12345.service",
    "uid": "[email protected]",
    "expires": "2020-06-11 21:04:14",
    "scope": "Office Manager",
    "apiversion": "Version: 41.1.0"
}

Masquerading as another user

A higher-scoped user can get a token for a lower-scoped user without that user’s password. For example, an Office Manager token can get a token on behalf of a Basic User, and the returned token works as if that user were making the API calls. First get the Office Manager’s token as shown above, then pass it as access_token. The mask_uid is always in <extension number>@<full domain string> form.

Request masqueraded token
curl --location --request POST 'https://uc.hopdial.com/ns-api/oauth2/token/' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=masquerade' \
--data-urlencode 'client_id=your-client-id' \
--data-urlencode 'client_secret=your-client-secret' \
--data-urlencode '[email protected]' \
--data-urlencode 'access_token=1e465ded5f3b4536aa71313b239a8162'
Returned masqueraded token
{
    "territory": "12345",
    "domain": "acmecorp.12345.service",
    "scope": "Basic User",
    "uid": "[email protected]",
    "access_token": "1357f6c97f418fc0289fc67507205668",
    "expires_in": 3600,
    "token_type": "Bearer",
    "refresh_token": "f9fe0e833c674d023e076d524e714260",
    "client_id": "your-client-id",
    "apiversion": "Version: 41.1.0"
}

Rate limits

Four policies apply by default:

PolicyLimit
subscriber_minute60 requests per minute
subscriber_hour1800 requests per hour
client_minute90 requests per minute
client_hour2700 requests per hour

Going over any limit returns HTTP 429 (Too Many Requests); wait until the window resets before sending more. Every response includes two headers so you can throttle before that happens:

Example response headers
HTTP/1.1 200 OK
RateLimit-Policy: "subscriber_minute";q=60;w=60;pk=:MTAwMEBhY21lLjEyMzQ1LnNlcnZpY2U=:,
                  "subscriber_hour";q=1800;w=3600;pk=:MTAwMEBhY21lLjEyMzQ1LnNlcnZpY2U=:,
                  "client_minute";q=90;w=60;pk=:eW91ci1jbGllbnQtaWQ=:,
                  "client_hour";q=2700;w=3600;pk=:eW91ci1jbGllbnQtaWQ=:
RateLimit: "subscriber_minute";r=59;t=31;pk=:MTAwMEBhY21lLjEyMzQ1LnNlcnZpY2U=:,
           "subscriber_hour";r=1799;t=331;pk=:MTAwMEBhY21lLjEyMzQ1LnNlcnZpY2U=:,
           "client_minute";r=89;t=31;pk=:eW91ci1jbGllbnQtaWQ=:,
           "client_hour";r=2699;t=331;pk=:eW91ci1jbGllbnQtaWQ=:
Content-Type: application/json; charset=UTF-8
  • RateLimit-Policy lists each policy: q is the quota for the window, w is the window length in seconds, and pk is a base64-encoded partition key identifying the user or client.
  • RateLimit shows current usage: r is the requests remaining and t is the seconds until the window resets.

The headers follow the IETF RateLimit header fields draft.

Common integrations

Click-to-call from your CRM

Start a call from any app: HopDial rings the user’s phone first, then dials the destination. Use an Office Manager login so one integration can place calls for every user on your domain.

Real-time call events (webhooks)

Subscribe once and HopDial POSTs call, CDR, recording, presence, agent and audit events to your URL. A call event with remove: yes means the call has ended. Set an expiration a few days out and renew it before it lapses.

Call reporting & CRM logging

Pull call detail records with start, answer and release times, duration and talk time to log calls against contacts or build your own dashboards.

Call recordings

Find the recording for a call using its call IDs, or turn recording on and off for a user — useful for compliance, QA and training workflows.

Endpoint reference

Each page lists the parameters, a curl example and sample responses.

CDR

Pull call detail records for reporting, billing reconciliation, and CRM call logging.

Time Frames

Create the business-hours schedules that answering rules use.

Voicemail

Read and delete voicemail messages and upload greetings.

Conference Bridges

Create, read, and update conference bridges.

Phone Number

Read and route the phone numbers (DIDs) on your domain.

Domains

Read and update your domain’s settings.

Call ID Emergency

Read the emergency caller ID numbers on your domain.

API FAQ

Does HopDial have an API for its phone system?

Yes. HopDial customers can use the HopDial phone system API at https://uc.hopdial.com/ns-api to place calls, control live calls, receive call events by webhook, pull call detail records (CDRs) and recordings, and manage users, call queues, answering rules, voicemail and devices.

How do I get API credentials?

Contact HopDial support to request a Client ID and Client Secret. You combine them with the username and password of a user who can log in to the HopDial portal to get an OAuth2 access token.

Which user should my integration log in as?

A Basic User token can only see and change that user’s own data. An Office Manager token can see and change data for everyone on your company’s domain, which is usually what CRM click-to-call and reporting integrations need.

What format does the API return?

Responses are XML by default. Add format=json to a request to get JSON instead.

Are there rate limits?

Yes. By default each user is limited to 60 requests per minute and 1,800 per hour, and each OAuth client to 90 requests per minute and 2,700 per hour. Going over returns HTTP 429 (Too Many Requests). The RateLimit headers on every response tell you how many requests remain.

Can I get notified when a call starts or ends instead of polling?

Yes. Create an event subscription (webhook) for the call model and HopDial will POST call events to your URL. Separate subscriptions are available for CDRs, recordings, presence, call queue agents and audit logs.

Will HopDial help with our integration?

Yes. HopDial is a hands-on provider: our team can issue credentials, help you choose the right user scope, and answer questions while you build. Call (866) 305-0407 or open a ticket with HopDial support.

Need API credentials or help with an integration?

HopDial customers can request a Client ID and Client Secret from support. Not a customer yet? Talk to us about a phone system your developers can build on.