Endpoints
GET
Get Entity
GET
https://papi.printtrackerpro.com/v1/entity/:entityID
Returns an entity object for the provided entity ID.
Path Parameters
entityID
string
- The ID of the entity
Headers
x-api-key
- Your Print Tracker API key
Query Parameters
includeChildren
boolean
optional - Whether the resulting entity should contain an array of children entity names and IDs at every hierarchical level under Print Tracker. This is useful for traversing entity hierarchy.
$ curl --request GET 'https://papi.printtrackerpro.com/v1/entity/<ENTITY-ID-HERE>?includeChildren=true' --header 'x-api-key: <API-KEY-HERE>'
GET
Get Devices by Entity
GET
https://papi.printtrackerpro.com/v1/entity/:entityID/device
Returns an array of devices that belong to the specified entity and (optionally) its children.
Path Parameters
entityID
string
- The ID of the entity
Headers
x-api-key
- Your Print Tracker API key
Query Parameters
includeChildren
boolean
optional - Defaults to false, determines whether we should return devices at the providedentityID
and all children entities or just the providedentityID
.limit
number
optional - Defaults to 100, determines the maximum number of devices in the response array.page
number
optional - Defaults to 1, determines the paginator's current page for the request.excludeDisabled
bool
- If enabled, only devices whose tracking status is 'Enabled' will be included in the final result.
$ curl --request GET 'https://papi.printtrackerpro.com/v1/entity/<ENTITY-ID-HERE>/device?limit=100&page=1&includeChildren=true' --header 'x-api-key: <API-KEY-HERE>'
An array of Device objects
GET
Get Meters by Entity
GET
https://papi.printtrackerpro.com/v1/entity/:entityID/meter
Returns an array of meter reads for the specified entity.
Path Parameters
entityID
string
- The ID of the entity
Headers
x-api-key
- Your Print Tracker API key
Query Parameters
start
date
- The start of the meter read date range formatted as RFC3339, ISO8601 (without timezone), RFC1123Z, RFC1123, RFC1123, RFC822Z, RFC822, RFC8250, ANSIC, or Unix.end
date
- The end of the meter read date range formatted as RFC3339, ISO8601 (without timezone), RFC1123Z, RFC1123, RFC1123, RFC822Z, RFC822, RFC8250, ANSIC, or Unix.excludeDisabled
bool
- If enabled, only meters from devices whose tracking status is 'Enabled' will be included in the final result.
$ curl --location --request GET 'https://papi.printtrackerpro.com/v1/entity/<ENTITY-ID-HERE>/meter?start=2020-12-18T17:52:52.417Z&end=2021-01-25T17:52:52.417Z' --header 'x-api-key: <API-KEY-HERE>'
An array of Meter Read objects
GET
Get Current Meters by Entity
GET
https://papi.printtrackerpro.com/v1/entity/:entityID/currentMeter
Returns an array of current meter reads for all devices at the specified entity. If includeChildren
is enabled and provided in the query string, this endpoint will return the current meter reads for all devices at the provided entity and any children of the provided entity. This endpoint is paginated, and the caller should pass a page and limit to paginate all the results from the endpoint.
Path Parameters
entityID
string
- The ID of the entity
Headers
x-api-key
- Your Print Tracker API key
Query Parameters
includeChildren
bool
- Whether the response should include current meters from devices at children of this entity.excludeDisabled
bool
- If enabled, only meters from devices whose tracking status is 'Enabled' will be included in the final result.page
int
- The pagination page that you want to return data for.limit
int
- The number of results in the pagination page. If the number of results is less than the limit, then you know you've retrieved all available meter reads.
$ curl --location --request GET 'papi.printtrackerpro.com/v1/entity/<ENTITY-ID-HERE>/currentMeter?includeChildren=true&page=1&limit=100' --header 'x-api-key: <API-KEY-HERE>'
An array of Meter Read objects
GET
Get Meters by Device
GET
https://papi.printtrackerpro.com/v1/entity/:entityID/device/:deviceID/meter
Returns an array of meter reads for the specified device.
Path Parameters
entityID
string
- The ID of the entitydeviceID
string
- The ID of the device
Headers
x-api-key
- Your Print Tracker API key
Query Parameters
start
date
- The start of the meter read date range formatted as RFC3339, ISO8601 (without timezone), RFC1123Z, RFC1123, RFC1123, RFC822Z, RFC822, RFC8250, ANSIC, or Unix.end
date
- The end of the meter read date range formatted as RFC3339, ISO8601 (without timezone), RFC1123Z, RFC1123, RFC1123, RFC822Z, RFC822, RFC8250, ANSIC, or Unix.
$ curl --location --request GET 'https://papi.printtrackerpro.com/v1/entity/<ENTITY-ID-HERE>/device/<DEVICE-ID-HERE>/meter?start=2021-01-08T17:52:52.417Z&end=2021-01-25T17:52:52.417Z' --header 'x-api-key: <API-KEY-HERE>'
An array of Meter Read objects
GET
Get Meter Immediately Prior to Date
GET
https://papi.printtrackerpro.com/v1/entity/:entityID/device/:deviceID/meter/mostRecentPriorTo
Returns the meter read for a device that is closest to, but not after the provided date
query parameter.
Path Parameters
entityID
string
- The ID of the entitydeviceID
string
- The ID of the device
Headers
x-api-key
- Your Print Tracker API key
Query Parameters
date
date
- The meter read returned will be the most recent meter read that occurred before this date, formatted as RFC3339, ISO8601 (without timezone), RFC1123Z, RFC1123, RFC1123, RFC822Z, RFC822, RFC8250, ANSIC, or Unix.
$ curl --location --request GET 'https://papi.printtrackerpro.com/v1/entity/<ENTITY-ID-HERE>/device/<DEVICE-ID-HERE>/meter/mostRecentPriorTo?date=2021-07-01T17:52:52.417Z' --header 'x-api-key: <API-KEY-HERE>'
A single Meter Read object
POST
Create a new entity
POST
https://papi.printtrackerpro.com/v1/entity/:entityID
Creates a new entity underneath an existing entity. The entity key in the path parameters should be the parent entity of the new entity. For example, assuming you have the following hierarchy:
Foo
Bar
New Entity
Then you would provide the entity key of "Bar" in the path parameter to create "New Entity" underneath "Bar".
Path Parameters
entityID
string
- The ID of the parent entity
Headers
x-api-key
- Your Print Tracker API key
Body
{
"name": "New entity"
}
$ curl --location --request POST 'https://papi.printtrackerpro.com/v1/entity/<ENTITY ID HERE>' \
--header 'x-api-key: <API-KEY-HERE>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "New entity"
}'
PUT
Update an existing entity
PUT
https://papi.printtrackerpro.com/v1/entity/:entityID
Updates an existing entity.
Path Parameters
entityID
string
- The ID of the parent entity
Headers
x-api-key
- Your Print Tracker API key
Body
{
"name": "Updated entity name"
}
$ curl --location --request PUT 'https://papi.printtrackerpro.com/v1/entity/<ENTITY ID HERE>' \
--header 'x-api-key: <API-KEY-HERE>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Updated entity name"
}'