Retrieving Standard Resources

Last updated last month

Data retrieval - standard resources

Get single object by unique key

To retrieve a single object use the get function for the desired resource

Only UUID is currently supported as a key

Supported Resources: accounts, transactions, activities, transactionLines, transactionScopeItems, allActivities.

pepperi.api.<resource>.get( { key: {UUID: "<UUID>"} , fields: [ <string array of relevant field names>] }

Example:

pepperi.api.activities.get(
‚Äč
{ key: {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8"} ,
fields: [ "ExternalID" , "MyTSA"] } )

Returns the following object that can be used for the "update" functions :

{success: true,
object:
{UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" ,
ExternalID: "ABC123" , MyTSA: 34.56
}}

Search list of objects by filter

To retrieve multiple objects use the search function for the desired resource - it returns the following object:

Supported resources: accounts, transactions, activities, transactionLines, allActivities.

pepperi.api.<resource>.search (filter: { <filter object> }, sort : [ <array of sort objects>} , pageSize : <number>, page: <number>)

Example:

pepperi.api.activities.search (
{
fields: [ "UUID", "ExternalID" , "MyTSA"] ,
filter: { Operation : "AND", LeftNode: {ApiName: "APIName1", Operation : ">",
Values : ["7"]},RightNode:{ApiName: "ApiName2",
Operation: "InTheLast", Values: ["4","Weeks"]} } ,
sort : [{Field: "MyTSA",Ascending: true},{Field: "MyTSA2",Ascending: true }] } ,
pageSize : 1000 , page: 1
});

Returns:

{success: true, objects:
[ {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" , ExternalID: "abc123", MyTSA: 12.8},
{UUID: "aefb5346-74ac-4041-8bb1-a76a3b5e734h" , ExternalID: "abc456", MyTSA: 34.5}
] }