Request Structure
The request URL consists of several parameters, such as host URL, API version, access token, API endpoint and required parameters. This topic describes the request structure, including request methods and request URL format.
Request example
User-Agent:
OpenAPI.Below is a request example of Edit an Extension.
POST /openapi/v1.0/extension/update?access_token=5SwyByhbSfsNlpI1v4GtHxEDmKsZwzjQ HTTP/1.1 Host: 192.168.5.150:8088 Content-Type: application/json User-Agent: OpenAPI { "id": 60, "presence_status":"off_work" }
POSTindicates the request method.openapi/v1.0is the API path that indicates the API version.extension/updateindicates the target API endpoint of Edit an Extension.access_token=5SwyByhbSfsNlpI1v4GtHxEDmKsZwzjQis the access token used for authentication.HTTP/1.1is the Hypertext Transfer Protocol.Hostindicates the IP address or the domain name of Yeastar P-Series PBX System.Content-Type:application/jsonindicates the format of request content.idandpresence_statusare the request parameters of Edit an Extension.
Request methods
- GET - to query information or execute delete operations.
- POST - to add an object or execute specific operations.
Request URL format
The request URL format is as follows:
{base_url}/{api_path}/{endpoint}?access_token={access_token}
- {base_url}
-
All URLs referenced in the documentation have the following base URL:
https://{pbx_ip}:{https_port}You can set the API base URL according to the web access settings on your PBX.
- If the web access protocol of PBX is HTTP, use the following
base URL:
http://{pbx_ip}:{http_port} - If the web access protocol of PBX is HTTPS, use the
following base URL:
https://{pbx_ip}:{https_port} -
If you use the Yeastar FQDN for remote API access, use the following base URL:
https://{pbx_fqdn_domain}Note: To remotely access API via Yeastar FQDN, you need to configure API remote access. For more information, see Configure Network for Remote API Access by a Yeastar FQDN.
- If the web access protocol of PBX is HTTP, use the following
base URL:
- {api_path}
- The format of API path is
openapi/{version}; the {version} indicates the API version.
- {endpoint}
-
Endpoint indicates the specific address of API request.
Refer to API Interfaces & Events Summary for all available API endpoints on Yeastar P-Series PBX System.
- {access_token}
Access token is used to authenticate API requests. The third-party application should Get Access Token before calling APIs. Each subsequent request requires the access token for authentication.
For detailed API authentication, see Authorization Rule.