Get Operation
Retrieve One Individual
This request retrieves a specific individual, identified by the individual’s ID value.
1/services/apexrest/v1/individual/individual_idThe individual_id value is a string that uniquely identifies the individual. The response body follows this format:
1{
2 "statusCode" : 3,
3 "responseBody" : {
4 "nextRecordUrl" : null,
5 "individuals" : {
6 individualid__c : {
7 [Values omitted]
8 },
9 }
10 },
11 "message" : "Number of Individuals retrieved: 1"
12}Retrieve All Individuals
- 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.
1/services/apexrest/v1/individual/?limit=1001{
2 "statusCode" : 8,
3 "responseBody" : {
4 "nextRecordUrl" : "/v1/individual/?limit=100&offset=100",
5 "individuals" : {
6 [Values omitted]
7 }
8 },
9 "message" : " Number of Individuals retrieved: 100"
10}1/services/apexrest/v1/individual/?limit=100&offset=1001{
2 "statusCode" : 8,
3 "responseBody" : {
4 "nextRecordUrl" : "/v1/individual/?limit=100&offset=200",
5 "individuals" : {
6 [Values omitted]
7 }
8 },
9 "message" : " Number of Individuals retrieved: 100"
10}1/services/apexrest/v1/individual/?limit=100&offset=2001{
2 "statusCode" : 3,
3 "responseBody" : {
4 "nextRecordUrl" : "null",
5 "individuals" : {
6 [Values omitted]
7 }
8 },
9 "message" : " Number of Individuals retrieved: 40"
10}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.
1/services/apexrest/v1/individual/?duration=7&limit=100&offset=01{
2 "statusCode" : 8,
3 "responseBody" : {
4 "nextRecordUrl" : "/v1/individual/?duration=7&limit=100&offset=100",
5 "individuals" : {
6 [Values omitted]
7 }
8 },
9 "message" : " Number of Individuals retrieved: 100"
10}1/services/apexrest/v1/individual/?duration=7&limit=100&offset=1001{
2 "statusCode" : 3,
3 "responseBody" : {
4 "nextRecordUrl" : "null",
5 "individuals" : {
6 [Values omitted]
7 }
8 },
9 "message" : " Number of Individuals retrieved: 95"
10}