Introduction to the NMS Prime API
The NMS Prime API is REST/JSON based. Using the API one can create, modify, delete or inspect database objects. The user input will be validated prior to storing it. If the validation fails a corresponding error message will be returned, informing the user which field failed validation.
A user is authenticated using BasicAuth. Currently only the user with the email address "api@localhost" is allowed to access the API. This user is authorized to create, modify, delete or inspect any database object. In future there will be the role "api" which can be assigned to any user having API access. Furthermore one will be able to grant the various API users different fine-grained access rights for the database objects, just like it is possible for the normal WebGUI.
For most users the most interesting objects will be:
- Telephone Number
By virtue of the HTTP/REST transport protocol many different clients can be used. We will only use curl and python in the upcoming examples.
See OpenAPI for a full API description: https://www.nmsprime.com/api/
Please use the email address as username, when trying to authenticate with the API. The password is the same you use to login to the NMS Prime web interface.
Inspecting database objects
You need to add verify=False in the get/post/patch statements, if you haven't set up a proper TLS certificate yet. You may do so using Getting a X.509 certificate via Let's Encrypt.
Creating, modifying and deleting database objects
Getting API URLs
In order to modify objects of other types than the ones mentioned above one needs to find the according API URL. This can be accomplished using the WebGUI by clicking on the according object. For example one may want to modify Endpoints. They can be retrieved using the WebGUI by clicking on "Provisioning" → "Endpoints". This leads to the URL https://localhost:8080/admin/Endpoint. Thus the API Base-URL for the endpoints will be: https://localhost:8080/admin/api/v0/Endpoint.
Postman API Demo Collection:
Set the variable "base_url" for the collection and enter your credentials (email and password) into Basic Auth fields.