This document introduces the basic structure of TLS OpenAPI requests.
TLS OpenAPI requests mainly consist of three parts:
- Request URL: Points to a specific business request.
- Request header: Includes the authentication information required for the API request.
- Request body: Includes the request parameters corresponding to the API. Do not pass the Body for interfaces without request parameters.
Each API document provides a request example for your reference; please implement the code yourself before initiating the request. When the interface call is successful, the returned parameters are displayed; if the call fails, the corresponding error message is shown. You can analyze and troubleshoot based on the error code.
Request URL
You can invoke the TLS API service by sending HTTPS requests. Https request URL format:
Note:
For example, to view projects (DescribeProjects), the unencoded HTTPS request URL is as follows.
The HTTP request header must specify Content-Type and public parameters, such as request authentication information, which are used to identify the user and the interface signature. Unless it is necessary to do so, individual API documentation will no longer describe these parameters; however, every request must include these parameters for the request to be initiated properly.
The Content-Type header specifies the structured format of the request body, and the Content-Type for TLS is always set to application/json. For the detailed parameter list and description, please refer to Common parameters. Request body
The request body, also known as the request message body, is primarily used to transmit business-related request parameters. To support Chinese in parameters in the request message body, Chinese characters must be encoded in UTF-8.
The content of the request message body differs for each interface, and not every interface requires a request message body (that is, the message body may be empty). When calling an interface, refer to the documentation for each API to construct the request message body.
Request methods
Request methods are used to communicate the type of operation for the current request to the server. TLS supports the following HTTP request methods.
Initiate a request
You can use curl, Postman, write code directly, or use other methods to send requests to call the API. For example, the request example for the ModifyProject interface is as follows: