Keep API token alive

A token expires after 30 minutes. To ensure communication between PBX and application server, you should call this API interface to keep the API token alive.

Note:
  • Every time you call this API, the token validity will be extended to 30 minutes.
  • If you select HTTP events, you can also call this API to edit the URL and port, which is used to receive events.

Request parameters

{base_url}/{api_path}/heartbeat?token={token}

Response parameters

Parameter Required Type Description
ipaddr Yes String IP address of the application server.
version No String Format version of event reports.
Note:
  • All URLs referenced in the documentation use API version v2.0.0.
  • If version is not specified, PBX will send events in version 1.0.0. We recommend that you specify the parameter to get events in correct format.
port No String

The application server would monitor the port and receive events sent from PBX through this port.

Note: If you select HTTP as report method, the parameter is required.

Default value: 8260.

url No String URL of the application server. This URL is used to specify the sending path of events to the application server.
Note:
  • The parameter is only applicable when the report method is HTTP.
  • If the parameter is not specified, the event will be sent to the IP address of the application server.
urltag No String Specify the URL type.
Note:
  • The parameter is only applicable when the report method is HTTP.
  • Using an absolute URL will ensure the API reports to be sent successfully in a complicated network environment.

Valid values:

  • 0: The URL is a relative URL.

    For example, the IP address of the application server is 110.22.2.3,port is 8260, url is "report"; PBX will send the API reports to 110.22.2.3:8260/report.

  • 1: The URL is an absolute URL.

    For example, the IP address of the application server is 110.22.2.3,url is "110.22.2.3:8260/report"; PBX will send the API reports to "110.22.2.3:8260/report".

Default values: 0.

Examples

Request example

POST /api/v2.0.0/heartbeat?token=277ac400357b509b4a587ff2157f7ad5 HTTP/1.1 HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 192.168.5.150
{
    "ipaddr": "192.168.6.24",
    "port": 8260,
    "version":"2.0.0"
}
Response example
HTTP/1.1 200 OK
Server: Boa/0.94.14rc21
Accept-Ranges: bytes
Connection: close
Content-Type: application/json
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE

{
    "status": "Success"
}