Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can test API methods on the interactive API browser page and without writing code
Some of the resources described on the page may not be available by default due to the type of application (see Creating and authorizing applications)

This resource is intended for finding out the registration addresses of the telephone terminal on the PBX and managing them. To set the static registration, use the phone terminal resource.

Table of Contents

Description of data structures

Expand
titleExpand

Data of a single registration (registration)

Name

Type

Description

contact_address

string

The registration address and port specified by the device during registration in the address:port format

device

object

Device Name (User Agent)

expires

long

The date (UTC) after which the registration will be lost (if it is not renewed by the device)

real_address

string

The address and port where the registration request actually came from (as opposed to contact_address)

registration_id

string

Unique registration ID

Data of all registrations (RegInfo)

Name

Type

Description

extension_id

integer

Unique ID of the internal number

registered

boolean

The value is "true" if there are active registrations. If the value is "false", the "registrations" array contains data about the last (already expired) registrations

registrations

array

Array of registration elements

Examples

For an internal number with ID 3, you need to find out the status of its registrations:

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"In the "},{"type":"text","text":"authentication ","marks":[{"type":"strong"}]},{"type":"text","text":"section enter the "},{"type":"text","text":"Application_ID","marks":[{"type":"strong"}]},{"type":"text","text":" and "},{"type":"text","text":"Application_Secret","marks":[{"type":"strong"}]},{"type":"text","text":" values obtained during the application registration in the "},{"type":"text","text":"client_id ","marks":[{"type":"strong"}]},{"type":"text","text":"and "},{"type":"text","text":"client_secret","marks":[{"type":"strong"}]},{"type":"text","text":" fields, then click on the \""},{"type":"text","text":"Try it out!","marks":[{"type":"strong"}]},{"type":"text","text":"\" button. If the application data is correct, an access token ("},{"type":"text","text":"access_token","marks":[{"type":"strong"}]},{"type":"text","text":") will be returned in response. The received access token should be entered into the \""},{"type":"text","text":"Access Token Field","marks":[{"type":"strong"}]},{"type":"text","text":"\" at the top of the page and saved by clicking the \""},{"type":"text","text":"Set Token","marks":[{"type":"strong"}]},{"type":"text","text":"\" button."}]},{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resourse","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"GET"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/registration/?extension_id=3"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":" "}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"136d4779-27f1-4840-a0c7-b9bda6c616a9","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"To send requests using the cURL program, set the values of the "},{"type":"text","text":"url ","marks":[{"type":"strong"}]},{"type":"text","text":"and "},{"type":"text","text":"access_token","marks":[{"type":"strong"}]},{"type":"text","text":" variables:"}]},{"type":"paragraph","content":[{"type":"text","text":"export url=\"https://<hostname>/api/ver1.0\"","marks":[{"type":"code"}]},{"type":"text","text":" "},{"type":"hardBreak"},{"type":"text","text":"(where the hostname — is the hostname of the API-server provider of IP-telephony),"}]},{"type":"paragraph","content":[{"type":"text","text":"export access_token=\"8SNsrS0jV35vfmKqKeKtRrHfpbg4UX\"","marks":[{"type":"code"}]},{"type":"text","text":" "},{"type":"hardBreak"},{"type":"text","text":"(the received access token)."}]},{"type":"paragraph","content":[{"type":"text","text":"Send a request:"}]},{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-X GET ${url}/extension/registration/?extension_id=3"}]}]},"id":"8d2929d7-ec4f-4e7b-8a16-155e4470b2c0","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[]}]},"id":"e8a6c641-5600-40b1-82e2-3bdfb245c313","label":"In Python3","type":"tab"}]

System response:

Code Block
languagejson
{     
  "registered":true,  
  "extension_id":3,  
  "registrations": [
    {        
      "device":"Yealink SIP-T46G 28.72.14.5",        
      "real_address":"sip:xxx.xxx.xxx.xxx:62338",        
      "contact_address":"sip:000*002@192.168.5.52:5062",        
      "expires":699,        
      "registration_id": "uloc-572b0ffb-6d47-001"   
    }
  ]
}

Now, let's delete the above registration:

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"DELETE"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/3/registration/uloc-572b0ffb-6d47-001"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":" "}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"dd87d80d-e504-45f8-86f4-9d0a6e742ffe","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-X DELETE ${url}/extension/3/registration/uloc-572b0ffb-6d47-001"}]}]},"id":"f901ec6e-0aed-48be-b307-a3d20ca87589","label":"cURL Program","type":"tab"}]

If the client has a lot of internal numbers, it is more convenient to get data about them in blocks:

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"GET"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/registration/?extension_id=3&extension_id=2"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":" "}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"2eb49bdd-1e71-4417-9cf7-3a334f588a54","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-X GET ${url}/extension/registration/?extension_id=3&extension_id=2"}]}]},"id":"cbc3fbaa-352a-422a-a7d8-5b63e5fb694f","label":"cURL Program","type":"tab"}]
Expand
titleSystem response:
Code Block
languagejson
[    
  {       
     "registered":true,        
     "extension_id":3,        
     "registrations":[            
       {               
          "device":"Yealink SIP-T46G 28.72.14.5",                
          "real_address":"sip:xxx.xxx.xxx.xxx:62338",                
          "contact_address":"sip:000*002@192.168.5.52:5062",                
          "expires":1764,                
          "registration_id":"uloc-5731d93c-4a88-51"            
        }        
      ]    
  },    
  {         
    "registered":true,        
    "extension_id":2,        
    "registrations":[            
      {                 
        "device":"Grandstream GXP2020 1.2.5.3",                
        "real_address":"sip:xxx.xxx.xxx.xxx:5060",                
        "contact_address":"sip:000*000@192.168.5.60:5060;transport=udp",                
        "expires":1444,                
        "registration_id":"uloc-570cfe57-aa6-8d4"            
       }        
     ]    
  }
]

Resources of the "Internal number" section

Expand
titleGET /extension/registration/

GET /extension/registration/

Get the registration status of all internal numbers

Request parameters

Name

Type

extension_id

array[integer]

Response fields

Name

Type

registered

boolean

extension_id

long

registrations

array[registration]

Expand
titleGET /extension/{extension_id}/registration/

GET /extension/{extension_id}/registration/

Get the internal number registration status

Request parameters

Name

Type

extension_id

string

Response fields

Name

Type

registered

boolean

extension_id

long

registrations

array[registration]

Expand
titleDELETE /extension/{extension_id}/registration/

DELETE /extension/{extension_id}/registration/

Delete all registrations on the internal number

Request parameters

Name

Type

extension_id

string

Expand
titleDELETE /extension/{extension_id}/registration/{registration_id}

DELETE /extension/{extension_id}/registration/{registration_id}

Delete a specific registration on an internal number

Request parameters

Name

Type

registration_id

string

extension_id

string