The Hive Inspect API is a work in progress. It is available to a small group of accounts today, and the release for everyone is coming very soon. To ask for early access, message us from the chat bubble in your dashboard.
data: the records on this pagenext_cursor: a value to fetch the next page, ornullwhen there are no moretotal: how many records match your filters across all pages
Page through a list
Request the first page
Set how many records you want with
limit. The default is 50 and the maximum is 200.Pass the cursor back
Take
next_cursor from the response and send it as cursor. Keep every other parameter the same.Things to know
- A page can be shorter than
limit. With some filters a page holds fewer records even though more pages follow. Always checknext_cursor, not the page size. - A cursor belongs to its request. Use a cursor only with the same filters and the same
sortit came from. A cursor from a different sort returns400. - Treat the cursor as opaque. Its format can change. Pass it back exactly as you received it.
totalcounts every page. It is the number of records that match your filters, not the size of this page. To get only a count, sendlimit=1and readtotal.
Fetch several records by id
Contacts, agencies and inspections accept anids parameter. Send up to 200 ids, separated by commas, to fetch them in one request:
- An id that is not in your account is left out. It does not cause an error.
- Other filters still apply, so
idstogether withrole=agentreturns only the agents among those ids. - On inspections,
idsalso returns canceled inspections. Deleted inspections needinclude_deleted=true. - Contact stats use
contact_idsinstead ofids.
Sorting
Most lists accept asort parameter. Add a - in front for descending order, for example sort=-scheduled_for for the newest inspections first. Each endpoint’s reference page lists the fields you can sort by.
Sync only what changed
To keep another system in sync, store the time of your last sync and ask only for newer records withupdated_since:
Pick up deleted inspections
A deleted inspection drops out of the normal list, so a sync would never learn it is gone. Addinclude_deleted=true to get deleted inspections too. Each one has deleted: true and a deleted_at time:
deleted: true, remove that inspection from your own system.
Overlap your sync window
Start each sync a few minutes before the last one ended. A record saved while your previous sync was running can otherwise be missed. Records you receive twice have the sameid, so they are safe to save again.
