Web API (Deprecated)
OpsGenie Web API lets you interact with alerts in OpsGenie from anything that can send an HTTP request. OpsGenie Web API is a RESTful API that is designed to allow you to integrate easily with OpsGenie:
- HTTP POST method is used for requests that create or update data,
- HTTP GET method is used for requests that only read data.
Making a Request
OpsGenie Web API is served over HTTPS. API can be accessed via the https://api.opsgenie.com domain. The relative path /v1/ indicates that we are currently using version 1 of the API. Hence all URLs referenced in this document have the following base: https://api.opsgenie.com/v1
Authentication
You authenticate to the OpsGenie Web API by providing the apiKey in the request. Create an API Integration and obtain your apiKey from integration page. Only Admins and Owners have right to manage integrations.
Request Format
For all requests except Attach File Request, the request body must be JSON.
Response Format
The response format for all requests is a JSON object. Whether a request succeeded indicated by the HTTP status code. A 2xx status code indicates success, whereas 4xx status code indicates failure. When a request fails, the response body is still a JSON object but contains the fields "code'" and "error" which can be used for debugging. For example, if the apiKey could not be found, the following JSON object would be returned:
{
"error" : "RestException[Could not authenticate.]",
"code: : 2
}
Updated about 7 years ago