Read all Persons
Retrieves a list of persons from the database
With this method, you send a request to the server to retrieve a subset of all persons, according to the filter criteria provided. For a collective request for a set of persons, you have these options:
-
You can restrict the set of persons to be retrieved by filter criteria based on the person name. In fact, defining filter criteria is mandatory. The system does not accept an unrestricted request for a list of all persons in the database.
- You can define that the set of matching persons shall not be transmitted all at once, but in a paged manner so that only a small number of results is transmitted, thereby reducing the server load.
Request
URI: /Persons
HTTP Method: GET
Permissions:
<bp>.r
<bp>.tenant.r
Query String Parameters
| Name | Required | Type | Description |
|---|---|---|---|
| $skip | No | integer | Number of the first n records to be excluded from the result set |
| $top | No | integer | Number of records to include in the result set |
| $orderby | No | string | Field name to be used for sorting the result set in ascending or descending order; valid fields are: basicData.businessPartnerID, basicData.etag, personName.formOfAddressDescription, personName.familyName, personName.additionalFamilyName, personName.familyNamePrefix, personName.middleName, personName.givenName, personName.initials, personName.academicTitleDescription, personName.additionalAcademicTitleDescription, communicationData.emailAddress, communicationData.streetName, communicationData.houseNumber, communicationData.cityName, communicationData.postalCode, communicationData.country, communicationData.region |
| $filter | No | string | Filter condition to be applied; valid fields are personName/familyName, personName/givenName, communicationData/emailAddress, basicData/businessPartnerID, objectGroup, and roleCategory |
| $count | No | integer | Returns the number of entries in the database, with filter conditions taken into account (if applicable) |
| Fields | Operators |
|---|---|
| personName/familyName, personName/givenName, communicationData/emailAddress, basicData/businessPartnerID, objectGroup, and roleCategory | eq, ne |
Request Example
/Persons
Retrieves all persons that are available in the database. Note that this formally unrestricted request is still implicitly restricted to Person objects in the current tenant for which the logged on user has an instance-based access authorization.
/Persons?$top=25&$orderby='personName.familyName' desc
Retrieves the first 25 persons. Data is retrieved in page mode to reduce network load and response times, and the retrieved persons are sorted by their family name in descending order.
/Persons?$skip=10&$top=20
Retrieves 20 persons from the database where the first 10 persons are omitted. That is, the retrieved persons are those with sequence numbers 11 through 30.
/Persons?$filter=personName/familyName eq 'Smith'
Retrieves all persons from the database whose family name is "Smith".
Response
Response Status and Error Codes
| Code | Reason |
|---|---|
| 200 | Persons retrieved successfully |
Payload
Format: JSON
Only media type JSON is supported. The JSON for this method has the following structure:
{"basicData" : {
"businessPartnerID": { "type": "string", "maxLength": 32 },
"tenant" : { "type": "string", "maxLength": 36, "required": true },
"etag" : { "type": "string" }
},
"personName": {
"formOfAddress" : { "type": "string", "maxLength": 10 },
"formOfAddressDescription": { "type": "string", "maxLength": 30, "readOnly" : true },
"familyName" : { "type": "string", "maxLength": 255, "required": true },
"additionalFamilyName": { "type": "string", "maxLength": 255 },
"familyNamePrefix": { "type": "string", "maxLength": 10 },
"middleName": { "type": "string", "maxLength": 255 },
"givenName": { "type": "string", "maxLength": 255, "required": true },
"initials": { "type": "string", "maxLength": 10 },
"academicTitle": { "type": "string", "maxLength": 4 },
"academicTitleDescription": { "type": "string", "maxLength": 60, "readOnly" : true },
"additionalAcademicTitle": { "type": "string", "maxLength": 4 },
"additionalAcademicTitleDescription" : { "type": "string", "maxLength": 60, "readOnly" : true }
},
"communicationData" : {
"emailAddress": { "type": "string", "maxLength": 255, "required": true },
"mobileDestinationLocation": { "type": "string", "maxLength": 2 },
"mobilePhoneNumber": { "type": "string", "maxLength": 127 },
"landlineDestinationLocation": { "type": "string", "maxLength": 2 },
"landlinePhoneNumber": { "type": "string", "maxLength": 127 },
"landlinePhoneNumberExtension": { "type": "string", "maxLength": 127 },
"streetName": { "type": "string", "maxLength": 255 },
"houseNumber": { "type": "string", "maxLength": 10 },
"cityName": { "type": "string", "maxLength": 255 },
"postalCode": { "type": "string", "maxLength": 10 },
"country": { "type": "string", "maxLength": 2 },
"countryDescription": { "type": "string", "maxLength": 60, "readOnly" : true },
"region": { "type": "string", "maxLength": 3 },
"regionDescription": { "type": "string", "maxLength": 60, "readOnly" : true }
},
"objectGroup": { "type": "string", "maxLength": 32, "required": "true" },
"externalIDs": {
value: [{ "type": "string", "maxLength": 60, "required": "false"}]
}
}