Open API is used to access and operate FlashDuty's entity data, such as viewing and managing configurations. Using the API is essentially the same as performing operations through the FlashDuty Console after logging in.If you want to push alerts from your own monitoring system to FlashDuty, please refer to Quick Start. How to Access#
Request URL#
All APIs only accept HTTPS protocol access, and there is only one Endpoint:Most requests use the POST method and pass parameters using JSON Payload. In this case, don't forget to set the Content-Type header.Character Encoding#
All APIs use UTF-8 encoding.Authentication#
All Open APIs use APP Key for authentication. You can obtain an APP Key by following these steps:1.
Log in to the FlashDuty Console
2.
Go to Account Settings - APP Key
page, enter a name, and click the add button to complete creation
Each APP Key represents an independent user and has all operation permissions of that user. Please store it securely and avoid leakage.
Usage Example#
Simply pass the APP Key as a query string parameter. If your APP Key is 5e8fbfcdbf14d00696153, the request URL would be:Response Structure#
Almost all request responses are in JSON format and follow this structure:Field Name | Required | Type | Description |
---|
request_id | Yes | string | Request ID for trace tracking |
error | No | Error | Error description, returned only when an error occurs |
data | No | interface{} | Data content, can be any format, refer to API definition for details |
Field Name | Required | Type | Description |
---|
code | Yes | string | Error code, see Code for enumeration values |
message | No | string | Error description |
Error Code | HTTP Status | Description |
---|
InvalidParameter | 400 | Parameter error |
InvalidContentType | 400 | Content-Type not supported |
MethodNotAllowed | 400 | HTTP Method not supported |
Unauthorized | 401 | Authentication failed |
AccessDenied | 403 | Authorization failed |
RequestTooFrequently | 429 | Request too frequent |
RouteNotFound | 404 | Request Method+Path not matched |
ResourceNotFound | 400 | Account hasn't purchased resource, please proceed to billing center |
NoLicense | 400 | Account has insufficient subscription license, please upgrade or purchase subscription in billing center |
InternalError | 500 | Internal or unknown error |