3.4 Working With Locations Via API

URI: https://myIsoraURL/api/locations

Verb

address

notes

additional details

GET

/locations

/locations?page=X

&page_size=Y

Retrieves a paginated list of all locations, Y at a time (25 by default). Only super-users can see confidential locations in the listing.

The beginning of each response includes a count and a link to the next page. Each entry in the list has a link to itself, which can be used to retrieve that individual location.

GET

/locations/<id>

Retrieves an individual location. If an invalid location id is given, a “Not found” error is returned.



POST

/locations

Creates a new location. The description and free_fields aren’t used by ISORA.

body {

  “site”: string,

  “building”: string,

  “room”: string,

  “floor”: string,*

  “confidential”: Boolean (true/false)*,

  “description”: string*,

  “free_fields”: json*

}

*optional

PUT

/locations/<id>

Updates (replaces) an existing location. Returns the updated location object.

Include the site, building and room, along with any other fields you want to change.



DELETE

/locations/<id>

Removes the location. No content is returned.

If any hosts are assigned to the location, the request will return an error.

GET

/locations?search=string

&page_size=Y

Returns location objects matching the string.