Getting Started
Overview
The Pepperi JS Client Side API (Beta) enables you to extend the functionality of Pepperi’s Native and Web Apps. This API operates within the Rule-Engine-based User Defined Fields (UDFs) or Workflow’s Custom Web Forms.
Namespace: pepperi.api
peperi.api Namespace:
Functions do not trigger auto-calculation of the app’s business logic (Rule Engine).
Suitable for use in calculated UDFs within the Rule Engine.
Only “api” functions are supported in the Rule Engine.
peperi.app Namespace:
Triggers the app’s business logic (Rule Engine) for calculations.
Supported functions:
peperi.app.accounts.update
peperi.app.activities.update
peperi.app.transactions.update
peperi.app.transactionLines.update
peperi.app.transactionScopeItems.update
peperi.app.transactions.addLines
peperi.app.transactions.removeLines
Both “api” and “app” namespaces can be used in Custom Web Forms (visible or hidden) as a step in a Workflow.
Asynchronous Behavior: Custom Web Forms vs Calculated UDFs
Custom Web Forms:
All Client API functions operate asynchronously.
Two additional parameters are required:
responseCallback: Callback function to handle the response.
requestID: Optional identifier for the request (recommended for tracking).
Example:
Calculated UDFs (Rule Engine):
Synchronous execution; no asynchronous parameters needed.
Date and Time Handling
API Format: Dates are retrieved and updated in UTC only, using ISO 8601 format (e.g., 2018-12-18T12:29:02Z or 2018-12-18Z).
Rule Engine Format:
Retrieved via GetValueByAPIName in Unix timestamp format (seconds since January 1, 1970, UTC).
Conversion required for updates. Example:
Filters: Dates in filter objects can be non-UTC; the function converts them internally to UTC.
Logging
Purpose: Send logs to Pepperi servers to track issues.
Behavior:
iOS/Android: Logs sent only on app crashes.
Web App: Logs sent constantly in real-time.
Syntax:
verbosity: Optional (Low, Medium, High); defaults to Low.
Error Handling
Error Object: All functions return the same error structure on failure:
Context Retrieval
Purpose: Retrieves the run-time scope, crucial for Custom Web Forms within Workflows.
Syntax:
Custom Web Forms (Async):
Calculated UDFs (Sync):
Returned Object:
Filter Object for Search Functions
Purpose: Used in “search” functions across the Client API to filter multiple objects.
Simple Example:
Complex Example with Multiple Conditions:
Supported Operators by Data Type:
Last updated
Was this helpful?