JS Client API
  • Getting Started
  • Rule Engine Unique Functions
  • Custom Form Window Functions
  • Known Issues
  • Use Cases & Code Samples
  • Retrieving Data
    • Retrieving Standard Resources
    • Retrieving User Defined Tables
    • Retrieving Attachments
    • Retrieving Items in Transaction Scope
    • Retrieving Transaction Lines
    • ADAL
  • Updating Data
    • Adding Objects to Standard Resources
    • Updating Standard resources
    • Updating User Defined Table
    • Updating Items in Transaction Scope
    • Adding Transaction Lines
    • Removing Transaction Lines
Powered by GitBook
On this page

Was this helpful?

  1. Retrieving Data

Retrieving Attachments

Retrieving attachments

Attachments should be retrieved in 2 steps:

  1. getting the attachment UUID from the object's field . e.g: Transaction.TSAMyImage1

  2. call pepperi.api.attachments.get ( while search can be used to get multiple images of certain item or category)

Get single attachment and list of attachments

Attachments are retrieved like a standard resource - the difference is in their optional fields and their response :

pepperi.api.attachments.get( { key:{UUID: ""}, fields:["UUID", "URI", "URL"]} )

Returns:

{ UUID : "659a8f38-9f8a-4286-b3dd-1973dd8c35b2",
  URI : ""
  URL:  "" }

Getting list of attachments :

pepperi.api.attachments.search (
{
fields:["UUID", "URI", "URL"],
filter: { ApiName: "URL", Operation : "Contains",
          Values : ["MyItem"]} ,
}
);

Returns:

{success: true, objects: 
[ {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" , URI:"" ,URL:"" },
  {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" , URI:"" ,URL:"" }
] }

URL: Will always return the attachment's web URL- no matter what is the app type - web or native

PreviousRetrieving User Defined TablesNextRetrieving Items in Transaction Scope

Last updated 5 years ago

Was this helpful?

URI: In case of native app it will return the base64 of the Binary Content in (embedded base64 URI)

data-URI format