Managing Request Using API
Welcome to ServiceOps Request Management API. Our APIs allow third party systems to create, update, and read a Request from our ServiceOps Platform.
All CRUD operations using APIs are done with the following methods: GET, POST, and DELETE.
First you need to setup your Client with our system and authenticate to acquire a Token ID. Using the Token ID you have to make all requests to our system.
Setting Up API Client
Before making any API requests, you have to register your Client with our ServiceOps system and acquire the below parameters:
- Client ID
- Client Secret
- Username
- Password
Log into the ServiceOps system, go to Admin > Integration (Under Automation), and register your product for REST API. For example: Here Postman is integrated with ServiceOps for using APIs.
Authorization
Authentication with our ServiceOps system allows you to acquire an access token, using which you have to make incident requests.
POST Get OAuth Token
URL: {{server-url}}/api/oauth/token
You have to make a POST request to the above endpoint using the following key-values:
Header
Key | Description |
---|---|
Authorization | Basic Client-ID:Client-Secret encoded in Base64. |
Body
Key | Description |
---|---|
username | UserName of user (registered with our ServiceOps system) for whom API to be Executed. |
password | Password of User (registered with our ServiceOps system) for whom API to be Executed. |
grant_type | OAuth2 Grant Type. (i.e. password) |
Example (Request & Response)
Request
curl --request POST \
--url 'http://{{server-url}}/api/oauth/token' \
--header 'Authorization: Basic bWFpbi13ZWItYXBwLWNsaWVudDptYWluLXdlYi1hcHAtc2VjcmV0' \
--header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
--form username=tim@acme.com \
--form password=123 \
--form grant\_type=password
Response
{
"access\_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJncmFudF90eXBlIjoicGFzc3dvcmQiLCJ1c2VyX25hbWUiOiJ0aW1AYWNtZS5jb20iLCJzY29wZSI6WyJtYWluLXdlYi1hcHAtc2NvcGUiXSwiZXhwIjoxNTM4Njg0NTkzLCJhdXRob3JpdGllcyI6WyJVU0VSIl0sImp0aSI6IjZkM2JkMWU5LTdhOTYtNDFmZS1hZmY5LTgyYmQ1ZDVmNWNiZiIsImNsaWVudF9pZCI6Im1haW4td2ViLWFwcC1jbGllbnQifQ.1pHYIEKAsBcjNf0xiwot5fcu0KOH2E4COqiusDuVh6I",
"token\_type": "bearer",
"refresh\_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJncmFudF90eXBlIjoicGFzc3dvcmQiLCJ1c2VyX25hbWUiOiJ0aW1AYWNtZS5jb20iLCJzY29wZSI6WyJtYWluLXdlYi1hcHAtc2NvcGUiXSwiYXRpIjoiNmQzYmQxZTktN2E5Ni00MWZlLWFmZjktODJiZDVkNWY1Y2JmIiwiZXhwIjoxNTQxMjY5MzkzLCJhdXRob3JpdGllcyI6WyJVU0VSIl0sImp0aSI6ImU2YWUxZTMxLWQzZWQtNGJkYi05NTY4LWRhNmQ3NmUwZWE4YiIsImNsaWVudF9pZCI6Im1haW4td2ViLWFwcC1jbGllbnQifQ.aFV-DBgNrSS2hF91qv\_zmtBsiRS2z3VsgnyoXVcAxeA",
"expires\_in": 7199,
"scope": "main-web-app-scope",
"jti": "6d3bd1e9-7a96-41fe-aff9-82bd5d5f5cbf"
}