Update Phone Number

Update the routing of a phone number in your domain.

POST/?object=phonenumber&action=update

Request URL

POST
https://uc.hopdial.com/ns-api/?object=phonenumber&action=update

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
dialplan
requiredbody
string

Must be "DID Table"

territory
requiredbody
string

Must be your HopDial territory ID

dest_domain
requiredbody
string

Domain the DID will be associated with

matchrule
requiredbody
string

Must be 10 digit DID with a prefix of "sip:1" and a postfix of "@*"

to_scheme
requiredbody
string

Must be "sip:"

Default: sip:

responder
requiredbody
string

Will almost always be "sip:start@to-user"

to_user
requiredbody
string

User part of the to URI

to_host
requiredbody
string

Domain the DID will be routed to

from_name
optionalbody
string

Set Caller ID Name of call to a specific DID. Keep "[*]" to pass Caller ID Name currently set in packet.

Default: [*]

from_user
optionalbody
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_host
optionalbody
string

Set host part of the FROM URI header. Keep "[*]" to keep from host currently in the FROM URI.

Default: [*]

plan_description
optionalbody
string

Set a description for the DID

Example request

text
curl https://uc.hopdial.com/ns-api/ \
   -H 'Authorization: Bearer 7bet078rqljh451l31uh34lsd0f80dsf' \
   -d object='phonenumber' \
   -d action='update' \
   -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

400 · application/json
{}

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.