Overview¶
TrueWatch Open API is a simplified HTTP REST API.
- Only GET / POST requests
- Use resource-oriented URLs to call APIs
- Use status codes to indicate request success or failure
- All requests return JSON structure
- Open API programmatically accesses the TrueWatch platform
Supported Endpoints¶
| Node Name | Endpoint |
|---|---|
| Overseas Region 1 (Oregon) | https://us1-openapi.truewatch.com |
| Europe Region 1 (Frankfurt) | https://eu1-openapi.truewatch.com |
| Asia Pacific Region 1 (Singapore) | https://ap1-openapi.truewatch.com |
| Africa Region 1 (South Africa) | https://za1-openapi.truewatch.com |
| Indonesia Region 1 (Jakarta) | https://id1-openapi.truewatch.com |
Common Request Headers¶
| Parameter | Type | Description |
|---|---|---|
| Content-Type | string | application/json |
| DF-API-KEY | string | Caller identifier, see API Key Management |
Authentication¶
The API uses API KEY as the authentication method. Each request uses the value of DF-API-KEY in the request header as a validity check and as the workspace limitation basis for this request (takes the workspace to which this DF-API-KEY belongs).
All interfaces currently displayed in the Open API only require an API KEY (Header: DF-API-KEY) as a credential. If the credential exists and is valid, the authentication is considered passed.
Common Response Structure¶
| Field | Type | Description |
|---|---|---|
| code | Number | The returned status code, same as the HTTP status code, fixed at 200 when no error |
| content | String, Number, Array, Boolean, JSON | The returned data, the specific type of data returned depends on the actual interface's business |
| pageInfo | JSON | Pagination information for all list interface responses |
| pageInfo.count | Number | Current page data count |
| pageInfo.pageIndex | Number | Page number |
| pageInfo.pageSize | Number | Page size |
| pageInfo.totalCount | Number | Total data count that meets the criteria |
| errorCode | String | The returned error status code, empty means no error |
| message | String | The specific description information corresponding to the returned error code |
| success | Boolean | Fixed as true, indicating the interface call was successful |
| traceId | Boolean | traceId, used to track each request situation |