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.
from CPI 15.85 supports also : items, catalogs, users, contacts.
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: ["UUID", "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}}
To retrieve multiple objects use the search function for the desired resource - it returns the following object:
Supported resources: accounts, transactions, activities, transactionLines, allActivities.
from CPI 15.85 supports also : items, catalogs, users, contacts.
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"]} } ,sorting : [{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}] }
Retrieve item's images:
TO BE DEVELOPED :
Add 12 new fields to items resource - both items.get and items.search functions.
The behavior is similar to attachments.get function = URL always returns URL , while URI field returns Base64 content when called from Mobile Device and URL when called from Web App. Field Names:
ImageURL
ImageURI
ImageURL2
ImageURI2
....Until 6 (Items resource supports up to 6 images per item)