Create Phone Number
Create (route) a phone number in your domain.
/?object=phonenumber&action=createRequest URL
https://uc.hopdial.com/ns-api/?object=phonenumber&action=createSend 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
| Name | Type | Description |
|---|---|---|
dialplanrequiredbody | string | Must be "DID Table" |
territoryrequiredbody | string | Must be your HopDial territory ID |
dest_domainrequiredbody | string | Domain the DID will be associated with |
matchrulerequiredbody | string | Must be 10 digit DID with a prefix of "sip:1" and a postfix of "@*" |
match_fromoptionalbody | string | If you wish to have this dial translation rule only apply to certain FROM headers (i.e ANIs). Example: sip:14072151863@* to have rule only apply to calls from 14072151863. Default: |
to_schemerequiredbody | string | Must be "sip:" Default: |
responderrequiredbody | string | Will almost always be "sip:start@to-user" |
to_userrequiredbody | string | User part of the to URI |
to_hostrequiredbody | string | Domain the DID will be routed to |
from_nameoptionalbody | string | Set Caller ID Name of call to a specific DID. Keep "[*]" to pass Caller ID Name currently set in packet. Default: |
from_useroptionalbody | string | Set from user or ANI of call in the user part of the FROM URI. Keep "[*]" to pass ANI currently set in packet. Default: |
from_hostoptionalbody | string | Set host part of the FROM URI header. Keep "[*]" to keep from host currently in the FROM URI. Default: |
plan_descriptionoptionalbody | string | Set a description for the DID |
Example request
curl https://uc.hopdial.com/ns-api/ \
-H 'Authorization: Bearer 7bet078rqljh451l31uh34lsd0f80dsf' \
-d object='phonenumber' \
-d action='create' \
-d territory = '11111' \
-d dest_domain='abc-company.11111.service' \
-d dialplan = 'DID Table' \
-d matchrule = 'sip:14071112222@*' \
-d to_scheme = 'sip:' \
-d responder = 'sip:start@to-user' \
-d to_host = 'abc-company.11111.service' \
-d to_user = '204' \
-d from_host = '[*]' \
-d plan_description = 'New Number'Responses
200 · application/xml
{}More Phone Number endpoints
Read and route the phone numbers (DIDs) on your domain.
Need a Client ID and Client Secret or help with this endpoint? Contact HopDial support or call (866) 305-0407.