Login
Enable API access on the Yeastar K2 VoIP PBX, then access the PBX by the API username and the encrypted MD5 API password.
- You need to encrypt the API password with MD5 first, and use the MD5 password to log
in.
The MD5 password should be in the format of 32 lowercase letters.
- If you log in failed consecutively for 5 times, you need to try after 10 minutes.
Endpoint
POST /api/v1.10/login
Request Parameters
Name | Importance | Type | Description |
---|---|---|---|
username
|
Required | String | The PBX API's username. |
password |
Required | String | The PBX API's password. Encrypt the password with MD5, then fill in the encrypted 32 lowercase letters. |
port |
Required | String | The API port number that is set on 3rd-party application. The PBX will send
API reports to the 3rd-party application via this port. Port range: 0 ~ 65536. |
version |
Optional | String | The version of API reports format. Note:
|
url |
Optional | String | URL of the application server. This URL is used to specify the sending path
of event report to the application server. Note: If the parameter is not specified, the event report will be sent to the IP
address of the application server.
|
urltag |
Optional | String | Specify the URL type:
|
Response Parameters
Name | Type | Description |
---|---|---|
token |
String | Token for interface invocation. |
- All API requests should contain an API
token
.The API
token
is generated when the 3rd-party application server logs in the PBX API successfully.
Examples
Request ExamplePOST /api/v1.1.0/login HTTP/1.1 Content-Type:application/json; charset=utf-8 Host: 192.168.5.150 { "username": "api", "password": "2d7257a528679d01a19c70e3fa773620", "port": "8260", "version": "1.0.2", "url": "110.22.2.3:8260/report", "urltag": "1" }
Login success.
Login failure.
HTTP/1.1 200 OK
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
{
"status": "Failed",
"errno": "30003"
}