Get information for one individual, some individuals, or all individuals in your org,
including all individuals with changes since a specific date.
The Industries REST API retrieves information from your org about:
Retrieve One Individual
This request retrieves a specific individual, identified by the individual’s ID value.
The individual_id value is a string that uniquely identifies the
individual. The response body follows this format:
The
fields and values returned are omitted here to save space. You can specify which fields to
omit by using
filtering.
Retrieve All Individuals
This request returns all individuals in your org. By default, a maximum of 200 individuals
are returned at one time, but you can lower the number with the
limit parameter. If there are more than 200 individuals, you can page through
the results, retrieving all the individuals in batches from different offsets. The
offset parameter specifies the end of the last batch
retrieved. For example, to retrieve 100 individuals at a time:
- Request the first 100 with an offset of 0.
- Request the second 100 with an offset of 100.
- Request the third 100 with an offset of 200.
- Continue until you’ve retrieved all records.
The
nextRecordUrl builds the next request for you.
Here’s the REST code for this example.
First, the initial GET request. We’ve omitted the offset value because it would be zero for
a first
request.
And
then the
response:
The
status code tells us
that the read operation isn’t finished. The next record URL tells us how to retrieve the
next batch of records. Our next request
is:
Notice
how we used the previous response’s
nextReordURL value
in the new request. The response
is:
According to the status code, more records remain. The next record URL value is almost the
same as the previous value. The only difference is that the offset is now 200, because we’ve
read the first 200 records. If we have 240 records total, the next request gets the
remainder.
The
response
is:
The status code shows that the read is complete and the next record URL is not set because
there are no more records. The message tells us that we retrieved 40 individuals, instead of
the 100 we expected.
Retrieve Individuals with Changes
A common task is to get only those individuals with changes since a certain date. For
example, you need all individuals that are new or have changes since the last quarterly
report. You specify the date with the number of days to today from the past date. For
example, today’s date is May 11, 2016, and you want the records created or changed since
January 1, 2016 for all individuals. Set duration to
131, the number of days from January 1 to May 11. You use the limit, offset, and nextRecordUrl parameters in the same way as when retrieving
multiple individuals.
Let’s get all the records created or modified in the last week. Here’s the GET
request.
And
the
response:
We see from the status code that there are more records, and the
nextRecordUrl value has prepared our next
request.
Here’s
the
response:
This
time we got 95 records, so we know that 195 records were created or modified in the past
week.