Pagination & Querying
Here's some helpful info on using Hint's top level ("list") resources.
Paging
limit
- This determines the maximum number of results that can be returned in the response. For example, setting this to 15 would return 15 patients, assuming there are at least 15 total patients for the given practice.
- Default: 10
- Min: 1
- Max: 100
- Example:
/patients?limit=12
offset
- This just "offsets" where the returned results should "start from". For example, you could send up one request with an offset
of 0, and limit
of 10. You'd get results 0-9. Then set the offset to be 10, and you'd get results 10-19.
- Default: 0
- Min: 0
- Max: Depend's on the resource's total count.
- Example:
/patients?offset=10
Sorting
sort
- Resources can be sorted on some of their attributes (eg. last name). See the individual "List All" routes for full details on available sort params. We do not currently support multiple sort params. Let us know if this is a problem though!
- Default: ASC sort.
- DESC sort: Prepend
-
to the attribute. - Examples:
/patients?sort=last_name
or/patients?sort=-created_at
.
Advanced Querying
Number Based - You can use objects with gt
(>), gte
(>=), lt
(<), lte
(<=) to aid in finding records based on numeric attributes. See examples below, but remember real requests must be URL encoded, of course!
- Example 1:
/charges?date={"gte":"2015-05-01","lt":"2015-06-01"}
. - Example 2:
/charges?created_at={"gt": "2015-02-19T10:49:21.419-08:00"}
String Based - You can also just directly enter a value for an attribute. This is case-insensitive.
- Example:
/patients?first_name=joe
Advanced Querying is only available on some endpoints such as the patient & customer_invoice endpoints. Reach out if you have a need for these on any other endpoints by emailing [email protected].
Metadata
Resource metadata is contained in the headers of the response.
x-count
- The number of resource objects returned in this response (eg. 3, 15, 82).
x-total-count
- The total number of resource objects that exist (eg. 102, 3325, 18).
Updated over 2 years ago