The Location object
Attributes
Unique identifier for the object.
ISO 8601 timestamp of when the object was created.
ISO 8601 timestamp of when the object was last updated.
Default: false
Default: false
{
"id": "location_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"parent_id": null,
"is_group": false,
"location_name": "location_name_example",
"parent_location": "parent_location_example",
"is_container": false,
"latitude": 0,
"longitude": 0,
"area": 0,
"area_uom": "area_uom_example",
"location": "location_example"
} /api/assets/location/{id} Retrieve a location
Retrieves the details of an existing location. Supply the unique location ID that was returned from a previous request.
Path parameters
The identifier of the location to retrieve.
Returns
Returns the location object if a valid identifier was provided.
curl https://api.overplane.dev/api/assets/location/location_abc123 \
-H "Authorization: Bearer sk_test_..." {
"id": "location_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"parent_id": null,
"is_group": false,
"location_name": "location_name_example",
"parent_location": "parent_location_example",
"is_container": false,
"latitude": 0,
"longitude": 0,
"area": 0,
"area_uom": "area_uom_example",
"location": "location_example"
} /api/assets/location List all locations
Returns a list of locations. The results are sorted by creation date, with the most recently created appearing first.
Query parameters
Maximum number of objects to return. Default: 20.
Number of objects to skip for pagination. Default: 0.
Returns
A paginated list of location objects.
curl https://api.overplane.dev/api/assets/location \
-H "Authorization: Bearer sk_test_..." {
"data": [
{
"id": "location_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"parent_id": null,
"is_group": false,
"location_name": "location_name_example",
"parent_location": "parent_location_example",
"is_container": false,
"latitude": 0,
"longitude": 0,
"area": 0,
"area_uom": "area_uom_example",
"location": "location_example"
}
],
"has_more": false,
"total": 1
} /api/assets/location Create a location
Creates a new location object.
Body parameters
Default: false
Default: false
Returns
Returns the newly created location object if the call succeeded.
curl https://api.overplane.dev/api/assets/location \
-H "Authorization: Bearer sk_test_..." \
-X POST \
-H "Content-Type: application/json" \
-d '{"location_name":"location_name_example"}' {
"id": "location_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"parent_id": null,
"is_group": false,
"location_name": "location_name_example",
"parent_location": "parent_location_example",
"is_container": false,
"latitude": 0,
"longitude": 0,
"area": 0,
"area_uom": "area_uom_example",
"location": "location_example"
} /api/assets/location/{id} Update a location
Updates the specified location by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Path parameters
The identifier of the location to update.
Body parameters
Default: false
Default: false
Returns
Returns the updated location object.
curl https://api.overplane.dev/api/assets/location/location_abc123 \
-H "Authorization: Bearer sk_test_..." \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"parent_id":null,"is_group":false}' {
"id": "location_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"parent_id": null,
"is_group": false,
"location_name": "location_name_example",
"parent_location": "parent_location_example",
"is_container": false,
"latitude": 0,
"longitude": 0,
"area": 0,
"area_uom": "area_uom_example",
"location": "location_example"
} /api/assets/location/{id} Delete a location
Permanently deletes a location. This cannot be undone.
Path parameters
The identifier of the location to delete.
Returns
Returns a confirmation that the location has been deleted.
curl https://api.overplane.dev/api/assets/location/location_abc123 \
-H "Authorization: Bearer sk_test_..." \
-X DELETE {
"id": "location_abc123",
"deleted": true
} /api/assets/location/{id}/children Get children
Returns the direct children of the specified node in the tree.
Path parameters
The identifier of the location to act on.
Returns
A list of direct child objects.
curl https://api.overplane.dev/api/assets/location/location_abc123/children \
-H "Authorization: Bearer sk_test_..." {
"id": "location_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"parent_id": null,
"is_group": false,
"location_name": "location_name_example",
"parent_location": "parent_location_example",
"is_container": false,
"latitude": 0,
"longitude": 0,
"area": 0,
"area_uom": "area_uom_example",
"location": "location_example"
} /api/assets/location/{id}/ancestors Get ancestors
Returns all ancestors from the immediate parent up to the root of the tree.
Path parameters
The identifier of the location to act on.
Returns
A list of ancestor objects from parent to root.
curl https://api.overplane.dev/api/assets/location/location_abc123/ancestors \
-H "Authorization: Bearer sk_test_..." {
"id": "location_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"parent_id": null,
"is_group": false,
"location_name": "location_name_example",
"parent_location": "parent_location_example",
"is_container": false,
"latitude": 0,
"longitude": 0,
"area": 0,
"area_uom": "area_uom_example",
"location": "location_example"
} /api/assets/location/{id}/descendants Get descendants
Returns all descendants of the specified node in the tree.
Path parameters
The identifier of the location to act on.
Returns
A list of all descendant objects.
curl https://api.overplane.dev/api/assets/location/location_abc123/descendants \
-H "Authorization: Bearer sk_test_..." {
"id": "location_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"parent_id": null,
"is_group": false,
"location_name": "location_name_example",
"parent_location": "parent_location_example",
"is_container": false,
"latitude": 0,
"longitude": 0,
"area": 0,
"area_uom": "area_uom_example",
"location": "location_example"
}