Overview¶
The TrueWatch Open API is a simplified HTTP REST API.
- Only GET / POST requests
- Uses resource-oriented URLs to call the API
- Uses status codes to indicate request success or failure
- All requests return JSON structures
- The Open API provides programmatic access to the TrueWatch platform
Supported Endpoints¶
| Node Name | Endpoint |
|---|---|
| Overseas Zone 1 (Oregon) | https://us1-openapi.truewatch.com |
| Europe Zone 1 (Frankfurt) | https://eu1-openapi.truewatch.com |
| Asia Pacific Zone 1 (Singapore) | https://ap1-openapi.truewatch.com |
| Asia Pacific Zone 2 (Singapore) | https://ap2-openapi.truewatch.com |
| Africa Zone 1 (South Africa) | https://za1-openapi.truewatch.com |
| Indonesia Zone 1 (Jakarta) | https://id1-openapi.truewatch.com |
Common Request Headers¶
| Parameter | Type | Description |
|---|---|---|
| Content-Type | string | application/json |
| DF-API-KEY | string | Caller identifier. For details, see API Key Management |
Authentication¶
The APIs use API Key for authentication. Each request uses the value of DF-API-KEY in the request Header as the validity check and as the basis for restricting the workspace of this request (the workspace to which this DF-API-KEY belongs).
All APIs exposed by the current Open API only require an API Key (Header: DF-API-KEY) as the credential. If the credential exists and is valid, authentication is considered passed.
Common Response Structure¶
| Field | Type | Description |
|---|---|---|
| code | Number | The returned status code, consistent with the HTTP status code; always 200 when there is no error |
| content | String, Number, Array, Boolean, JSON | The returned data; the specific type of data returned depends on the business of the actual API |
| pageInfo | JSON | Pagination information for all list API responses |
| pageInfo.count | Number | Number of records on the current page |
| pageInfo.pageIndex | Number | Page index |
| pageInfo.pageSize | Number | Page size |
| pageInfo.totalCount | Number | Total number of records matching the criteria |
| errorCode | String | The returned error code; empty means no error |
| message | String | Detailed description corresponding to the returned error code |
| success | Boolean | Whether the API call succeeded: true on success, false on failure |
| traceId | String | traceId, used to track every request |