Retrieving Standard Resources
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.
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:
1
pepperi.api.activities.get({
2
key: { UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" },
3
fields: ["UUID", "ExternalID", "MyTSA"]
4
});
Copied!
Returns the following object that can be used for the "update" functions :
1
{success: true,
2
object:
3
{UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" ,
4
ExternalID: "ABC123" , MyTSA: 34.56
5
}}
Copied!

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.
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:
1
pepperi.api.activities.search (
2
{
3
fields: [ "UUID", "ExternalID" , "MyTSA"] ,
4
filter: { Operation : "AND", LeftNode: {ApiName: "APIName1", Operation : ">",
5
Values : ["7"]},RightNode:{ApiName: "ApiName2",
6
Operation: "InTheLast", Values: ["4","Weeks"]} } ,
7
sorting : [{Field: "MyTSA",Ascending: true},{Field: "MyTSA2",Ascending: true }] ,
8
pageSize : 1000 , page: 1
9
});
Copied!
Returns:
1
{success: true, objects:
2
[ {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" , ExternalID: "abc123", MyTSA: 12.8},
3
{UUID: "aefb5346-74ac-4041-8bb1-a76a3b5e734h" , ExternalID: "abc456", MyTSA: 34.5}
4
] }
Copied!
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:
    1.
    ImageURL
    2.
    ImageURI
    3.
    ImageURL2
    4.
    ImageURI2
    5.
    ....Until 6 (Items resource supports up to 6 images per item)
Last modified 1yr ago