|
<< Click to Display Table of Contents >> Navigation: IMS version 21.9 > IMS Admin - User Guide > REST API > Postman examples IMS REST API |
** WORK IN PROGRESS ** This section is yet to be updated to the newer version of IMS Feature location, commands, instructions, and screen shots may not appear the same if you are using a newer version of IMS |
In this section the REST API is explained using POSTMAN
Login to IMS rest API:
Send a post request with basic authentication and fill in Username / password:

The server will send you a token which is needed in your following calls.
Get an entity with an Id:
In this case we use site entity as an example:
Use the bearer token as Authentication and use the Guid just received from the login:
http://192.168.5.14/api/ims/site/153433

To retrieve also navigation properties (For instance the City object) then we add a parameter to the request like:
http://192.168.5.14/api/ims/site/153433?navigationproperty=2
Navigation properties
Navigation properties are used to get related information of the object.
For example to get the city details when you search for a site (location).
Or to get the shelves within the equipment.
Every entity has its own unique navigation property number and they can be added.
For example: if City and also Customer details are needed, the navigation property to use is 6
(City = 2 and Customer = 4)
As 6 is not a navigation property number for another entity, IMS will understand it should provide City and Customer details.
Please use the documentation for the navigation properties: https://wcf.vc4.com/


When you want to receive the City And Customer navigation property you should use:
2+4 = 6
http://192.168.5.14/api/ims/site/153433?navigationproperty=6
Get an entity by name (Only when entity name is unique)
http://192.168.5.14/api/ims/site/byname/HHWD009
Parameters allowed:
Navigationproperty
Get entities filtered.
Filter on Property:
http://192.168.5.14/api/ims/site/filtered/street=PRUNUSLAAN
Filter on navigation property:
http://192.168.5.14/api/ims/site/filtered/city.name=LONDON
Operators allowed:
<
>
<>
=
== (Is not)
IS NOT NULL
IS NULL
LIKE
Parameters allowed:
Navigationproperty
PaginatorStartElement (When you expect big results this parameter can help retrieve the data in chunks)
PaginatorNumberOfElements (When you expect big results this parameter can help retrieve the data in chunks)
Example:
http://192.168.5.14/api/ims/site/filtered/city.name=LONDON?PaginatorStartElement =1&PaginatorNumberOfElements =2
The Add/update/delete method can be used wth Post/Put/Delete requests and the data in the body is based on the bulkloader of IMS. (Only 1 record per call allowed)
Add example:
POST:
http://192.168.5.14/api/ims/site

{"id": "",
"propertyandvalues":
[
{"property": "name","value": "TEST_SITE_GERARD"},
{"property": "SiteTypeId","value": "core"},
{"property": "Street","value": "gerards rigo straat"},
{"property": "houseNumber","value": "1"},
{"property": "Zipcode","value": "1827RV"},
{"property": "CityId","value": "alkmaar"},
{"property": "CustomerId","value": "sdh"}
]
}
Update example:
PUT:
http://192.168.5.14/api/ims/site

{"id": "name:TEST_SITE_GERARD",
"propertyandvalues":
[
{"property": "Street","value": "Rigolettostraat"}
]
}
Note that you don’t need to fill in the Id of the entity as long as you know the Unique name, in this case:
name:TEST_SITE_GERARD
Please check helpfile in the bulkloader section for more examples.
Delete example:
DELETE:
http://192.168.5.14/api/ims/site

{"id": "name:TEST_SITE_GERARD",
"propertyandvalues": []
}