Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Public API for NMIS configuration. "omk/admin/api/v2/"

We can manage the Administration Configuration resources below admin configurations using this API:- using these endpoints -  http://host/en/omk/admin/api/v2/resource

Resource is our term for items in a configuration file or database.

Our current resource list consists of locations, contacts, services, escalations, events, polling-policy, users, access, customers and businessservices.

The resources can be accessed using the web interface or the API.

API Routes

Each resource has a consistent set of operations

Request Method

Operation

URL Example

id required

Notes

POSTcreate/resourcenInsert a new resource.
GETread list/resourcenReturns a list of resources.
GETread one/resource/idyReturns the details of a resource.
PUTupdate/resource/idyUpdate the details of a resource.
DELETEdelete/resource/idyDelete a resource.




This API can help you to manage the below operations for the given admin configurations. (Please see the link for All System Admin Configurations).


Important: All the operations are authenticated. 

Operation

Method

URL

Example

AuthenticatePOSThttp://host/en/omk/admin/login
Code Block
{"username": "your username", "password": "your password"}


We should receive a 200 response and a cookie, that we can reuse for next API calls. 



Example:- 

Resource
Name
OperationMethodURLResponseExample
 code-block
LocationsCreatePOSThttp://host/en/omk/admin/api/v2/locations.json
new

New Location in NMIS configurations.

       
    "Address1": "",
       
    "Address2": "",
       
    "City": "",
       
    "Country": "",
       
    "Floor": "",
       
    "Geocode": "fake geo code",
       
    "Latitude": "xx.xxxxxxx",
       
    "Location": "Mandatory param",
       
    "Longitude": "xx.xxxxxxx",
       
    "Postcode": "",
       
    "Room": "",
       
    "State": "",
       
    "Suburb": ""
  
}


Locations
GET
Read listGEThttp://host/en/omk/admin/api/v2/locations.jsonLocations present in NMIS configuration file.
theme
language
FadeToGrey
js
[
    {
       
         "Address1": "Eden",
       
         "Address2": "",
       
         "City": "Wellington",
       
         "Country": "New Zealand",
       
         "Floor": "",
       
         "Geocode": "
fake geo code
Island Bay, Wellington, New Zealand",
       
         "Latitude": "
xx
-41.
xxxxxxx
3372593",
        "Location": "Mandatory param",        
         "Location": "Island Bay DC",
         "Longitude": "174.7726262",
         "Postcode": "",
         "Room": "",
         "State": "",
         "Suburb": "Island Bay",
         "_id": "Island Bay DC"
     },
     {
         "Address1": "",
         "Address2": "",
         "City": "",
         "Country": "",
         "Floor": "",
         "Geocode": "Melbourne VIC, Australia",
         "Latitude": "-37.8136276",
         "Location": "MelbourneDC",
         "Longitude": "
yy
144.
yyyyyyy
9630576",
       
         "Postcode": "",
       
         "Room": "",
       
         "State": "",
       
         "Suburb": ""
    }
,
         "_id": "MelbourneDC"
    }
]


Locations
Update
Read one
PUT
GEThttp://host/en/omk/admin/api/v2/locations/{location-name}.json
Updated location entry
Locations present in NMIS configuration file.
Mandatory param.json

Amsterdam.json

Code Block
{
    "Address1": "",
    "Address2": "",
    "City": "",
    "Country": "Netherlands",
    "Floor": "",
    "Geocode": "Amsterdam, Netherlands",
    "Latitude": "52.3675734",
    "Location": "Amsterdam",
    "Longitude": "4.9041389",
    "Postcode": "",
    "Room": "",
    "State": "",
    "Suburb": "",
    "_id": "Amsterdam"
}


LocationsUpdatePUT
LocationsDeleteDELETE
http://host/en/omk/admin/api/v2/locations/{location-name}.json
Deletes the
Updated location entry
from configurations

http://apollo.opmantek.net:8080/en/omk/admin/api/v2/locations/

Mandatory param

Mandatory%20param.json

Important: All this methods are authenticated. 

Code Block
themeFadeToGrey
{
    "Address1": "42 Main Street",
    "Address2": "",
    "City": "",
    "Country": "",
    "Floor": "",
    "Geocode": "fake geo code",
    "Latitude": "xx.xxxxxxx",
    "Location": "Mandatory param",
    "Longitude": "yy.yyyyyyy",
    "Postcode": "",
    "Room": "",
    "State": "",
    "Suburb": ""
}


LocationsDeleteDELETE

Operation

Method

URL

Example

AuthenticatePOST
http://host/en/omk/admin
/login
/api/v2/locations/{location-name}.jsonDeletes the location entry from configurations
uburnto
/opHA/login
username
redirect_to":
 "username", "password": "password"}

...

 null,
    "success": 1
}