Read
2 min
You can read all the contacts from Xero without passing any filters. However, to get only the filtered response results, you can add the following filters as "queryParameters" as shown in the below example.
Param Name | Type | Description |
|---|---|---|
order | String | Order by any element returned |
page | String | Up to 100 contacts will be returned per call when the page parameter is used. e.g. page=1 |
includeArchived | Boolean | e.g. includeArchived=true Contacts with a status of ARCHIVED will be included in the response |
IDs | String | Filter by a comma-separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. |
where | String | Filter using the where parameter. We recommend you limit filtering to the optimised elements only. |
Example:
// Create a Map to store all the data of a Contact
Map<String, Object> contactFiltersMap = new Map<String, Object>();
contactFiltersMap.put('IDs', 'd7b9fa11-1b1b-4751-a0bb-1cbae4f43240');
// Initializing the Request Data to be passed.
Map<String, Object> reqObj = new Map<String, Object>();
reqObj.put('version', '1.0');
reqObj.put('action', 'readContact');
reqObj.put('queryParameters', contactFiltersMap);
//Required, if Xero Multi-Org is enabled in Breadwinner.
reqObj.put('xeroOrgId', '!aa00TM');
// Placing a request to Breadwinner Global API
Map<String, Object> respMap = bread_winner.BreadwinnerXeroAPI.call(reqObj);
System.debug(respMap);