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.
- 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:
|
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:
|
urltag | No | String | Specify the URL type. Note:
Valid values:
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" }
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" }