Skip to end of banner
Go to start of banner

System Admin Configuration API

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »


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

We can manage the Administration Configuration resources below using this API:- 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

id required

Operation

URL Example

Notes

POSTncreate/resourceInsert a new resource.
GETyread one/resource/idReturns the details of a resource.
GETnread list/resourceReturns a list of resources.
PUTyupdate/resource/idUpdate the details of a resource.
DELETEydelete/resource/idDelete a resource.


API ResourcesLocationsContactsServicesEscalationsEventsPolling-PolicyUsersAccessCustomersBusinessServices

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
{"username": "username", "password": "password"}

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



Example:- 

ResourceOperationMethodURLResponseExample
LocationsCreatePOSThttp://host/en/omk/admin/api/v2/locations.json

New Location in NMIS configurations.

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

{
        "Address1": "",
        "Address2": "",
        "City": "",
        "Country": "",
        "Floor": "",
        "Geocode": "fake geo code",
        "Latitude": "xx.xxxxxxx",
        "Location": "Mandatory param",
        "Longitude": "xx.xxxxxxx",
        "Postcode": "",
        "Room": "",
        "State": "",
        "Suburb": ""
    }
LocationsRead listGEThttp://host/en/omk/admin/api/v2/locations.jsonLocations present in NMIS configuration file.

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

NEED AN EXAMPLE

LocationsRead oneGEThttp://host/en/omk/admin/api/v2/locations/{location-name}.jsonLocations present in NMIS configuration file.

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

{
    "Address1": "",
    "Address2": "",
    "City": "",
    "Country": "Netherlands",
    "Floor": "",
    "Geocode": "Amsterdam, Netherlands",
    "Latitude": "52.3675734",
    "Location": "Amsterdam",
    "Longitude": "4.9041389",
    "Postcode": "",
    "Room": "",
    "State": "",
    "Suburb": "",
    "_id": "Amsterdam"
}
LocationsUpdatePUThttp://host/en/omk/admin/api/v2/locations/{location-name}.jsonUpdated location entry

http://apollo.opmantek.net:8080/en/omk/admin/api/v2/locations/Mandatory%20param.json

 {
        "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": ""
    }
LocationsDeleteDELETEhttp://host/en/omk/admin/api/v2/locations/{location-name}.jsonDeletes the location entry from configurations

http://apollo.opmantek.net:8080/en/omk/admin/api/v2/locations/Mandatory%20param.json

{
    "redirect_to": null,
    "success": 1
}




  • No labels