Last updated 2 years ago
You can count the total number of objects of a given type as follows:
/api/v4/backend-deployment-id/objects/model/count.json
/api/v4/
backend-deployment-id
/objects/
model
/count.json
GET
Replace model with the type of object that you wish to retrieve (as defined in your app's Data Model), for example person, job or asset.
person
job
asset
BASE-URL
The below examples contain a BASE-URL placeholder. Please refer to the section to get the base URL relevant to your deployment.
Count the number of task objects:
task
GET BASE-URL/api/v4/533bda53027894f69b001055/objects/tasks/count.json
curl "BASE-URL/api/v4/533bda53027894f69b001055/objects/tasks/count.json" \ -u "533bda53027894f69b001055:7Ajj5htRY1uzw7b4w23V"
require 'rest-client' journey = RestClient::Resource.new "BASE-URL/api/v4", "533bda53027894f69b001055", "7Ajj5htRY1uzw7b4w23V" journey["533bda53027894f69b001055/objects/tasks/count.json"].get
Response
{"count":3,"type":"task"}
You can also count the number of objects returned by a .