Request Structure
This topic describes the structure of Yeastar Partner Portal API requests, including HTTP request method, request URL, and request authentication.
Request example
An example for a request of Query Order List is shown
below.
GET /order/openapi/order/v1/page?pageNo=1&pageSize=3&sort=id HTTP/1.1
Host: openapi.partner.yeastar.com
User-Agent: OpenAPI
Authorization: Bearer {access_token}
GET
specifies the request method./order/openapi/order/v1/page
is the target API endpoint of querying order list.HTTP/1.1
is the Hypertext Transfer Protocol.Host: openapi.partner.yeastar.com
specifies the domain name of the server.User-Agent
provides information about the user agent, such as the type of web browser, operating system, software version, etc., so as to help Yeastar Partner Portal to identify the user or the application that is making the request.Authorization: Bearer {access_token}
is used to authenticate the request.
Request methods
Yeastar Partner Portal API supports the following request methods:
HTTP method | Usage |
---|---|
GET | Query data from Yeastar Partner Portal. |
POST | Send data to Yeastar Partner Portal to create a new resource or perform a specific operation. |
Request URL
The request URL format is shown
below:
{base_url}/{endpoint}
- {base_url}
-
All URLs referenced in the guide have the following base URL:
https://openapi.partner.yeastar.com
- {endpoint}
- Endpoint indicates the specific address of API request.
Authenticate requests
After obtaining an access token, the third-party application can send the access token to the Authorization field in the HTTP header when making API requests. In this way, the authorization server can authenticate the API requests.
Authorization Format
Authorization: Bearer {access_token}
Authorization
Example
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21Kd3RQYXlsb2FkSW5mbyI6eyJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJ5c0lkIjoxNzg5NjM2MDM5MDg1MDI1NzM0OSwicmVmcmVzaFZlcnNpb24iOjE2Mzg5NDM5MTJ9LCJzY29wZSI6WyJhbGwiXSwiZXhwIjoxNjM4OTQ1NzEyLCJhdXRob3JpdGllcyI6WyJST0xFX0NMSUVOVCJdLCJqdGkiOiJhNzgwMTA3Yi0wOGE1LTRmM2YtODY4Yi04NjFmMjUxOWUxMzAiLCJjbGllbnRfaWQiOiJrcDl5eW50bXVlc3VrNWpvV3ZNa1RiQ0J4cU82TEtSaCJ9.iX7FMOQQKuiKLCNO8wBtnKz6n3Ydv-OFtcut3j8JV-o