Incident API Resources --> please check the API Resource tab
Table of Contents
- Prerequisite before starting
- Authentication prerequisite
- Get all my incidents
- Filter the incidents list
- Pagination of the incidents list
- Get details of an Incident
- Error handling
Prerequisite before starting
- For this "Getting started", we will use the command-line tool Curl.
- The API requires the generation of an API-Key.
- Your Orange Business Services representative will provide you this API key
- The API key must be added to HTTP headers of each API call.
- The header is
X-Api-Key
. - The API requires also the generation of an API-Key. API-Key expires after 2 years and must be renewed by asking to Orange Support.
Authentication prerequisite
Access to this API is secured by the OAuth 2.0 framework with the Client Credentials grant type, which means that you will have to present an OAuth 2.0 access_token
whenever you want to request this API.
It's easy to negotiate this access_token
: just send a request to the proper token negotiation endpoint, with a Basic Authentication header valued with your own client_id
and client_secret
.
For this API, the token negotiation endpoint is:
https://api.orange.com/oauth/v3/token
A technical guide is available to learn how to negotiate and manage these access_token
.
A guide for oAuth 2.0 authentication method is also available in "Getting started" with Postman document.
Get all my incidents
List all my incidents without filter, sort or paging
Request
- Method & URL :
GET
,https://api.orange.com/incident/b2b/v1/incidents
- Authorization : OAuth 2.0 authentication to get the access token (see "Prerequisite before starting" section)
- Header : add
x-api-key
=> Value provided by your administrator
curl -X GET \
-H "Authorization: {access_token}" \
-H "X-API-key: {dev_key}" \
https://api.orange.com/incident/b2b/v1/incidents
Response
Header
you will receive 3 specific headers:
HTTP/1.1 200 OK
for a successful answerX-Result-Count
, the number of IncidentsX-Total-Count
, the number of all Incidents matching criteria.
HTTP/1.1 200 OK
X-Result-Count: 25
X-Total-Count: 106
Body
List of incidents in a json format
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
"id": "1805N42320",
"status": "VALIDATED",
"impact": "S1",
"priority": "P1",
"serviceCondition": "INTERUPTED",
"description": "Alarme détectée a la supervision/Alarm detected in supervision Line unavailability",
"origin": "PROACTIVE",
"type": "FAILURE",
"isEscalated": false,
...
Filter the incidents list
You have the possibility to filter a collection by adding to the URI some attributes.
Example : retrieve incidents occured in France and with a priority "P1".
Request
- Add the following parameters to the URL :
location.address.country=FR&priority=P1
.
curl -X GET \
-H "Authorization: {access_token}" \
-H "X-API-key: {dev_key}" \
https://api.orange.com/incident/b2b/v1/incidents?location.address.country=FR&Priority=P1
Response
- List of your filtered incidents in a json format
Pagination of the incidents list
The API provides a pagination mechanism with the following query parameters
offset
: The index of the first element to retrieve. Zero is the first item of the collection.limit
: The maximum number of items to return.sort
: The comma-separated list of field names to sort the result. Prefixing a field name with a "-" sign will indicate a descending order.
Thanks to these 3 query parameters, you are able to retrieve Incidents page per page.
Example: to get the next 20 Incidents from the 10th Incident of the global list and ordered by the creation date :
Request
- Add the following parameters to the URL :
offset=10&limit=20&sort=-createdAt
.
curl -X GET \
-H "Authorization: {access_token}" \
-H "X-API-key: {dev_key}" \
https://api.orange.com/incident/b2b/v1/incidents?offset=10&limit=20&sort=-createdAt
Response
- List of 20 incidents in a json format
Get details of an Incident
With the Incidents for Business API, you are able to retrieve all information about a specific incident.
You only need the id of the incident (you can retreive it from the incidents list).
Request
- Add the the id of the incident (you can retreive it from the incidents list) to the URL :
/{incident_id}
.
curl -X GET \
-H "Authorization: {access_token}" \
-H "X-API-key: {dev_key}" \
https://api.orange.com/incident/b2b/v1/incidents/{incident_id}
Response
- Your incident in a json format
Error handling
Orange APIs use appropriate HTTP status codes to indicate any request processing error. For more details, see Handling API errors.
Refresh delay
Incident created/updated from the API: Real time Incident created/updated by Orange: +/- 3 minutes (since version 1.3)