Articles in this section

integrator.io API and JavaScript runtime objects

This article includes all integrator.io API modules and runtime objects. You can also use Postman to trigger standard integrator.io REST APIs.

Warning

JavaScript runtime object CRUD (create, read, update, and delete) functions are not supported in hooks.

Tip

Press the Home key to return to the top of this article (Fn +Left Arrow for Mac).

Warning

Any hook that calls an export, lookup, or import must be in an integration tile rather than a standalone flow. You cannot call a resource inside a hook if your hook is in a standalone flow. To call a resource inside a hook, create a new integration tile and then add your flow to the tile.

Runtime object

Options

Export

(Scriptable objects)

Imports

(Scriptable objects)

Flows

(Scriptable objects)

Connections

Integrations

Access Tokens

Async Helpers

File Definitions

State

Lookup caches

(Scriptable objects)

Export runtime objects

Exports

This runtime object represents one or more exports in your account and allows you to access them via script.

exports.find( query )

Finds all exports matching the query. If no query is provided, then this function returns all exports accessible to the script.

Argument

<query Object>

A simple object containing the key-value pairs representing your search criteria. For example, you could assign a custom externalId value and then retrieve the export with that ID.

Note

externalId is the only value supported in the query object.

Returns

<Array>

An array of exports.

Exceptions

This function throws an error if the API call fails for any reason.

exports.get( _id )

Returns the export associated with the given ID.

Argument

_id <String, required>

The ID of the export.

Returns

<Object|Undefined>

The export or undefined.

Exceptions

This function throws an error if the API call fails for any reason.

exports.create( export )

Creates an export.

Argument

export <Object, required>

The export to be created.

Returns

<Object>

An object representing the new export.

Exceptions

This function throws an error if the API call fails for any reason.

exports.update( export )

Updates the specified export.

Argument

export <Object, required>

The updated export to save.

Returns

<Object>

An object representing the updated export.

Exceptions

This function throws an error if the API call fails for any reason.

exports.patch( options )

Patches the export, updating only the specific fields and values provided.

Argument

options <Object, required>

Contains the following properties:

  • _id <String, required> – the ID of the export to patch

  • patch <Object, required> – the specific fields and values to update

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

exports.delete( _id )

Deletes the export associated with the given ID.

Argument

_id <String, required>

The ID of the export to delete.

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

exports.run( options )

Runs the export associated with the given ID.

Warning

Passing a webhook alias in exports.run is not supported.

Argument

options <Object, required>

Contains the following properties:

  • _id <String, required> – the ID of the export to run

  • startDate <Date> – start date for delta exports as a Date object

  • endDate <Date> – end date for delta exports as a Date object

  • data <Array / Object> - data to pass to export

  • settings <Object> - settings to pass to export

  • listenerData <Array> – pass data in this structure to an integrator.io application-type webhook listener; if you need to pass a value from your script to the export, instead call exports.runVirtual().

Both the “data” and “settings” can be passed to the JSRT function in the following manner:

exports.run({_id: '5f4••••••••••••••••••d34', data: myData, settings: expSettings})

The following handlebar format needs to be used in the export to pass the data dynamically:

NetSuite - Array {{[0].id}} ; Object {{id}}

Others - Array {{data.[0].id}} ; Object {{data.id}}

Returns

<Object>

The response object has the following properties:

  • data <Array> – the data that was exported; this function returns only the first page of records, to retrieve additional results call exports.runVirtualWithPaging().

  • dataURIs <Array> – matching URI array; dependent on export configuration

  • errors <Array> – any errors returned by the export

Exceptions

This function throws an error if the API call fails for any reason.

Example: listenerData syntax

  import { exports } from 'integrator-api'

function main(options) {
  const myData = [{
    name: 'Celigo customer',
    email: 'celigocustomer@celigo.com'
  }]
  return {
    statusCode: 200,
    body: {
      response: exports.run({_id: '5f4••••••••••••••••••d34', listenerData: myData})
    }
  }
}

exports.runVirtual( options )

Runs a virtual export using an existing connection. A virtual export is one that you create with script and do not add to your account.

Argument

options <Object, required>

Contains the following properties:

  • export <Object, required> – the virtual export definition to run

  • startDate <Date> – start date for delta exports as a Date object

  • endDate <Date> – end date for delta exports as a Date object

  • data <Object> – data to be sent to the export

Returns

<Object>

The response object has the following properties:

  • data <Array> – the data that was exported

  • dataURIs <Array> – matching URI array; dependent on virtual export configuration

  • errors <Array> – any errors returned by the export

Exceptions

This function throws an error if the API call fails for any reason.

Example: Run a virtual export in JavaScript APIs

Example: Form JavaScript with a NetSuite virtual export. Use this approach anytime you:

  • Need to populate a dropdown with more than 100 items

  • Want to dynamically control what’s shown based on NetSuite data

  • Prefer not to create a Saved Search in NetSuite

The script functions as follows:

  1. The formInit function is a Celigo hook that runs when the settings form is loaded. It allows you to dynamically build form fields and populate them with data.

  2. The script creates a field named netSuiteAccountMapping. This is a static map field type (like a dropdown with key-value pairs), where:

    1. The key is the account reference

    2. The value is the NetSuite account name

    This field is added to the form layout so it will be displayed to users.

  3. The function getNetsuiteAccounts() calls a virtual export to pull all active NetSuite accounts using a built-in NetSuite RESTlet call. You do not need a saved search—the script builds the search criteria directly in JavaScript. Here’s what it fetches:

    1. Only accounts where isinactive = false (i.e., active accounts)

    2. For each account, it grabs:

      1. internalid (used as the option value)

      2. name (used as the label shown in the dropdown)

    These results are added to the dropdown.

  4. The script uses exports.runVirtual(...) to perform an on-demand data fetch. This is important because:

    1. It bypasses the 100-record limit

    2. It’s asynchronous, meaning it won’t slow down the form

    3. You don’t need to define this export separately in the integrator.io—it’s defined in code

import { exports } from 'integrator-api';

const NETSUITE_CONNECTION_ID = '612••••••••••5e7';

function formInit(options) {
  
  let form = { fieldMap: {}, layout: { fields: [] } };

  let netSuiteAccountMapping = {
    id: "netSuiteAccountMapping",
    name: "netSuiteAccountMapping",
    label: "Netsuite Account Mapping",
    type: "staticMap",
    keyName: "AccountReference",
    keyLabel: "Account Reference",
    valueName:  "NetsuiteAccount",
    valueLabel:  "Netsuite Account",
    keyOptions: [],
    valueOptions: []
  }

  let netsuiteAccounts = getNetsuiteAccounts();
  console.log('Netsuite: ' + JSON.stringify(netsuiteAccounts))
  for (let m of netsuiteAccounts) {
    netSuiteAccountMapping.valueOptions.push(m);
  }

  form.fieldMap.netSuiteAccountMapping = netSuiteAccountMapping;
  form.layout.fields.push('netSuiteAccountMapping');

  options.resource.settingsForm.form = form;
  return options.resource.settingsForm.form;
}
  

function getNetsuiteAccounts() {
    return exports.runVirtual({
      "export": {
        "name": "Get Netsuite GL Accounts",
        "_connectionId": NETSUITE_CONNECTION_ID,
        "asynchronous": true,
        "netsuite": {
            "restlet": {
              "recordType": "account",
              "useSS2Restlets": false,
              "criteria": [
                {
                  "field": "isinactive",
                  "operator": "is",
                  "searchValue": "F"
                }
              ],
              "columns": [
                {
                  "name": "name",
                  "label": "label"
                },
                {
                  "name": "internalid",
                  "label": "value"
                }
              ]
            },
            "type": "restlet",
            "skipGrouping": true,
            "statsOnly": false
          }
      }
    }).data;
  }

exports.runVirtualWithPaging( options )

Runs a virtual export using an existing connection, and returns one page of data at a time.

Arguments

options <Object, required>

Contains the following properties:

  • export <Object, required> – the virtual export definition to run

  • pagedExportState <Object> – the state object that was returned (as-is) by the last call to this function

  • startDate <Date> – start date for delta exports as a Date object

  • endDate <Date> – end date for delta exports as a Date object

Returns

<Object>

The response object has the following properties:

  • data <Array> – the data that was exported

  • dataURIs <Array> – matching URI array; dependent on virtual export configuration

  • pagedExportState <Array> – the state object to send (as-is) to the next call to this function

  • errors <Array> – any errors returned by the export

Exceptions

This function throws an error if the API call fails for any reason.

Import runtime objects

Imports

The imports object represents one or more imports found in your account and allows you access to them via script.

imports.find( query )

Finds all imports matching the query. If no query is provided, then this function returns all imports accessible to the script.

Argument

query <Object>

A simple object containing the key-value pairs representing your search criteria. For example, you could assign a custom externalId value and then retrieve the import with that ID.

Note

externalId is the only value supported in the query object.

Returns

<Array>

An array of imports.

Exceptions

This function throws an error if the API call fails for any reason.

imports.get( _id )

Returns the import associated with the given ID.

Argument

_id <String, required>

The ID of the import.

Returns

<Object|Undefined>

The import or undefined.

Exceptions

This function throws an error if the API call fails for any reason.

imports.create( import )

Creates an import.

Argument

import <Object, required>

The import to be created.

Returns

<Object>

An object representing the new import.

Exceptions

This function throws an error if the API call fails for any reason.

imports.update( import )

Updates the import.

Argument

import <Object, required>

The updated import to save.

Returns

<Object>

An object representing the updated import.

Exceptions

This function throws an error if the API call fails for any reason.

imports.patch( options )

Patches the import, updating only the specific fields and values provided.

Argument

options <Object, required>

Contains the following properties:

  • _id <String, required> – the ID of the import to patch

  • patch <Object, required> – the specific fields and values to update

Returns

<Undefined>

An object representing the updated import.

Exceptions

This function throws an error if the API call fails for any reason.

imports.delete( _id )

Deletes the import associated with the given ID.

Argument

_id <String, required>

The ID of the import to delete.

Returns

<Undefined>

An object representing the updated import.

Exceptions

This function throws an error if the API call fails for any reason.

imports.run( options )

Runs the import associated with the ID provided.

Argument

options <Object, required>

Contains the following properties:

  • _id <String, required> – the ID of the import to run

  • data <Array, required> – the data to import

  • settings <Object> - settings to pass to import

Both the “data” and “settings” can be passed to the JSRT function in the following manner:

imports.run({_id: '6f7••••••••••••••••••e46', data: myData, settings: impSettings})

The following handlebar format needs to be used in the import to pass the data dynamically:

NetSuite - Array {{[0].id}} ; Object {{id}}

Others - Array {{data.[0].id}} ; Object {{data.id}}

Returns

<Array>

Each response array has the following properties:

  • statusCode <Integer> – 200 (success), 422 (error), or 401 (connection is offline)

  • ignored <Boolean> – true if ignored by the import; dependent on import configuration

  • errors <Array> – the errors returned by the import

  • _json <Object> – the raw response object returned by the import application

Exceptions

This function throws an error if the API call fails for any reason.

imports.runVirtual( options )

Runs a virtual import using an existing connection. A virtual import is one that you create with script and do not add to your account.

Argument

options <Object, required>

Contains the following properties:

  • import <Object, required> – the virtual import definition to run

  • data <Array, required> – the data to import

Returns

<Array>

Each response array has the following properties:

  • statusCode <Integer> – 200 (success), 422 (error), or 401 (connection is offline)

  • ignored <Boolean> – true if ignored by the import; dependent on virtual import configuration

  • errors <Array> – the errors returned by the import

  • _json <Object> – the response object returned by the import application

Exceptions

This function throws an error if the API call fails for any reason.

imports.runMapping( options )

Runs the mapping instructions only within a virtual import.

Argument

options <Object, required>

Contains the following properties:

  • import <Object, required> – the virtual import definition containing the mapping instructions

  • data <Array, required> – the data to map

Returns

<Array>

Each response array has the following properties:

  • statusCode <Integer> – 200 (success), 422 (error), or 401 (connection is offline)

  • data <Object> – the mapped data

  • errors <Array> – the mapping errors returned by the import

Exceptions

This function throws an error if the API call fails for any reason.

Flow runtime objects

Flows

The flows object represents one or more flows found in your account and allows you access to them via script.

flows.find( query )

Finds all flows matching the query. If no query is provided, then this function returns all flows accessible to the script.

Argument

query <Object>

A simple object containing the key-value pairs representing your search criteria. For example, you could assign a custom externalId value and then retrieve the flow with that ID.

Note

externalId is the only value supported in the query object.

Returns

<Array>

An array of flows.

Exceptions

This function throws an error if the API call fails for any reason.

flows.get( _id )

Returns the flow associated with the given ID.

Argument

_id <String, required>

The ID of the flow.

Returns

<Object|Undefined>

Each response array has the following properties:

Exceptions

This function throws an error if the API call fails for any reason.

flows.create( flow )

Creates a flow.

Argument

flow <Object, required>

The flow to be created.

Returns

<Object>

An object representing the new flow.

Exceptions

This function throws an error if the API call fails for any reason.

flows.update( flow )

Updates the flow.

Argument

flow <Object, required>

The updated flow to save.

Returns

<Object>

An object representing the updated flow.

Exceptions

This function throws an error if the API call fails for any reason.

flows.patch( options )

Patches the flow, updating only the specific fields and values provided.

Argument

options <Object, required>

Contains the following properties:

  • _id <String, required> – the ID of the flow to patch

  • patch <Object, required> – the specific fields and values to update

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

flows.delete( _id )

Deletes the flow associated with the given ID.

Argument

_id <String, required>

The ID of the flow to delete.

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

flows.run( options )

Runs the flow associated with the ID provided.

Argument

options <Object, required>

Contains the following properties:

  • _id <String, required> – the ID of the flow to run

  • startDate <Date> – start date for delta exports as a Date object

  • endDate <Date> – end date for delta exports as a Date object

Returns

<Object>

An object representing the flow run status.

Exceptions

This function throws an error if the API call fails for any reason.

Connections runtime objects

Connections

The connections object represents one or more connections found in your account and allows you access to them via script.

connections.find( query )

Finds all connections matching the query. If no query is provided, then this function returns all connections accessible to the script.

Argument

query <Object>

A simple object containing the key-value pairs representing your search criteria. For example, you could assign a custom externalId value and then retrieve the connection with that ID.

Note

externalId is the only value supported in the query object.

Returns

<Array>

An array of connections.

Exceptions

This function throws an error if the API call fails for any reason.

connections.get( _id )

Returns the connection associated with the given ID.

Argument

_id <String, required>

The ID of the connection.

Returns

<Object|Undefined>

The connection or undefined.

Exceptions

This function throws an error if the API call fails for any reason.

connections.create( connection )

Creates a connection.

Argument

connection <Object, required>

The connection to be created.

Returns

<Object>

An object representing the new connection.

Exceptions

This function throws an error if the API call fails for any reason.

connections.update( connection )

Updates the connection.

Argument

connection <Object, required>

The updated connection to save.

Returns

<Object>

An object representing the updated connection.

Exceptions

This function throws an error if the API call fails for any reason.

connections.patch( options )

Patches the connection, updating only the specific fields and values provided.

Argument

Options <Object, required>

Contains the following properties:

  • _id <String, required> – the ID of the connection to patch

  • patch <Object, required> – the specific fields and values to update

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

connections.delete( _id )

Deletes the connection associated with the given ID.

Argument

_id <String, required>

The ID of the connection to delete.

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

Integrations runtime objects

Integrations

An integration object allows you to find, modify, or remove an existing integration in your account.

integrations.get( _id )

Returns the integration associated with the given ID.

Argument

_id <String, required>

The ID of the integration.

Returns

<Object|Undefined>

The integration or undefined.

Exceptions

This function throws an error if the API call fails for any reason.

integrations.update( integration )

Updates the integration.

Argument

integration <Object, required>

The updated integration to save.

Returns

<Object>

An object representing the updated integration.

Exceptions

This function throws an error if the API call fails for any reason.

integrations.delete( _id )

Deletes the integration associated with the ID provided.

Argument

_id <String, required>

The ID of the integration to delete.

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

Access tokens runtime objects

Access tokens

The accessTokens object represents the access tokens available in your account.

accessTokens.find( query )

Finds all access tokens matching the query. If no query is provided, then this function returns all access tokens accessible to the script.

Argument

query <Object>

Simple object containing the key-value pairs representing your search criteria. For example, you could assign a custom externalId value and then retrieve the token with that ID.

Note

externalId is the only value supported in the query object.

Returns

<Array>

An array of access tokens.

Exceptions

This function throws an error if the API call fails for any reason.

accessTokens.get( _id )

Returns the access token associated with the given ID.

Argument

_id <String, required>

The ID of the access token.

Returns

<Object|Undefined>

The access token or undefined.

Exceptions

This function throws an error if the API call fails for any reason.

accessTokens.create( accessToken )

Creates an access token.

Argument

accessToken <Object, required>

The access token to be created.

Returns

<Object>

An object representing the new access token.

Exceptions

This function throws an error if the API call fails for any reason.

accessTokens.update( accessToken )

Updates an access token.

Argument

accessToken <Object, required>

The updated access token to save.

Returns

<Object>

An object representing the updated access token.

Exceptions

This function throws an error if the API call fails for any reason.

accessTokens.delete( _id )

Deletes the access token associated with the given ID.

Argument

_id <String, required>

The ID of the access token to delete.

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

Async helper runtime objects

asyncHelpers

The async helpers object represents one or more async helpers found in your account and allows you access to them via script.

asyncHelpers.find( query )

Finds all async helpers matching the query. If no query is provided, then this function returns all Async Helpers accessible to the script.

Argument

query <Object>

A simple object containing the key-value pairs representing your search criteria. For example, you could assign a custom externalId value and then retrieve the Async Helper with that ID.

Note

externalId is the only value supported in the query object.

Returns

<Array>

An array of Async Helpers.

Exceptions

This function throws an error if the API call fails for any reason.

asyncHelpers.get( _id )

Returns the async helpers associated with the ID provided.

Argument

_id <String, required>

The ID of the Async Helper.

Returns

<Object|Undefined>

The Async Helper or undefined.

Exceptions

This function throws an error if the API call fails for any reason.

asyncHelpers.create( asyncHelper )

Creates an async helper.

Argument

asyncHelper <Object, required>

The Async Helper to be created.

Returns

<Object>

An object representing the new Async Helper.

Exceptions

This function throws an error if the API call fails for any reason.

asyncHelpers.update( asyncHelper )

Updates the specified async helper.

Argument

asyncHelper <Object, required>

The updated Async Helper to save.

Returns

<Object>

An object representing the updated Async Helper.

Exceptions

This function throws an error if the API call fails for any reason.

asyncHelpers.delete( _id )

Deletes the async helper associated with the given ID.

Argument

_id <String, required>

The ID of the Async Helper to delete.

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

File definitions runtime object

File Definitions

A file definition instructs integrator.io how to parse an EDI template. This JavaScript object lets you retrieve or modify all file definitions in your account. The file definitions object represents one or more file definitions found in your account and allows you access to them via script.

fileDefinitions.find( query )

Finds all file definitions matching the query. If no query is provided, then this function returns all file definitions accessible to the script.

Argument

query <Object>

A simple object containing the key-value pairs representing your search criteria. For example, you could assign a custom externalId value and then retrieve the file definition with that ID.

Note

externalId is the only value supported in the query object.

Returns

<Array>

An array of file definitions.

Exceptions

This function throws an error if the API call fails for any reason.

fileDefinitions.get( _id )

Returns the file definition associated with the given ID.

Argument

_id <String, required>

The ID of the file definition.

Returns

<Object|Undefined>

The file definition or undefined.

Exceptions

This function throws an error if the API call fails for any reason.

fileDefinitions.create( fileDefinition )

Creates a file definition.

Argument

fileDefinition <Object, required>

The file definition to be created.

Returns

<Object>

An object representing the created file definition.

Exceptions

This function throws an error if the API call fails for any reason.

fileDefinitions.update( fileDefinition )

Updates the file definition.

Argument

fileDefinition <Object, required>

The updated file definition to save.

Returns

<Object>

An object representing the updated file definition.

Exceptions

This function throws an error if the API call fails for any reason.

fileDefinitions.delete( _id )

Deletes the file definition associated with the given ID.

Argument

_id <String, required>

The ID of the file definition to delete.

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

State runtime object

State

The state object contains a JSON field that you can attach to a resource. You can then change its value, as needed, during processing and check the value during a later point in your script.

state.getKeysForResource( options )

Retrieves all resource-specific keys.

Argument

options <Object, required>

Contains the following properties:

  • resourceType <String, required> – pass integrations , flows , imports , exports , or connections

  • _id <String, required> – the ID of the resource

Returns

<Object>

An object containing all keys.

Exceptions

This function throws an error if the API call fails for any reason.

state.getForResource( options )

Retrieves the value associated with a resource-specific key.

Argument

options <Object, required>

Contains the following properties:

  • resourceType <String, required> – pass integrations , flows , imports , exports , or connections

  • _id <String, required> – the ID of the resource

  • key <String, required> – the key to retrieve

Returns

<Object>

The value associated with the key.

Exceptions

This function throws an error if the API call fails for any reason.

state.putForResource( options )

Updates the value for a resource-specific key.

Argument

options <Object, required>

Contains the following properties:

  • resourceType <String, required> – pass integrations , flows , imports , exports , or connections

  • _id <String, required> – the ID of the resource

  • key <String, required> – the key to update

  • value <Object> – the value to update

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

state.deleteForResource( options )

Deletes a resource-specific key and value.

Argument

options <Object, required>

Contains the following properties:

  • resourceType <String, required> – pass integrations , flows , imports , exports , or connections

  • _id <String, required> – the ID of the resource

  • key <String, required> – the key to update

Returns

<Undefined>

Exceptions

This function throws an error if the API call fails for any reason.

Lookup cache runtime objects

Lookup caches

This runtime object represents one or more lookup caches in your account and allows you to access them via script. See also, Create & manage lookup caches

Tip

You must register the lookup cache with an integration before you can reference and edit the lookup cache data via script hooks. For more information, see Register lookup caches & create aliases.

lookupcaches.find( query )

Finds lookup caches matching the query. If no query is provided, then this function returns all lookup caches accessible to the script.

Arguments 

query<Object>

A simple object containing the key-value pairs representing your search criteria. If query is provided, it can include only the following property:

externalId: You can assign a custom externalId value, for example: externalID: "testLookup" at the time of lookup cache creation, and then retrieve the lookup cache with that externalId.

Note

externalId is the only value supported in the query object.

Returns 

<Array>

An array of lookup caches.

Exceptions 

This function throws an error if the API call fails for any reason.

lookupcaches.get( _id )

Returns the lookup cache associated with the given ID.

Arguments 

_id <String, required>

The ID of the lookup cache to be retrieved.

Returns 

<Object| Undefined>

An object that includes high-level fields in the lookup cache; or, undefined, that is, no content.

Exceptions 

This function throws an error if the API call fails for any reason.

lookupcaches.create( cache )

Creates a lookup cache.

Arguments 

cache <Object, required>

The lookup cache to be created.

Returns 

<Object>

An object that includes the new lookup cache.

Exceptions 

This function throws an error if the API call fails for any reason.

lookupcaches.update( cache )

Updates the specified lookup cache.

Arguments 

cache <Object, required>

The lookup cache to be updated.

Returns 

<Object>

An object that includes the updated lookup cache.

Exceptions 

This function throws an error if the API call fails for any reason.

lookupcaches.patch( options )

Patches the lookup cache, updating specific fields and values.

Arguments 

options <Object, required>

Contains the following properties:

  • _id <String, required> – The ID of the lookup cache to patch.

  • patch <Array <Objects>, required> – Specific fields and values to update.

Returns 

<Undefined>

Exceptions 

This function throws an error if the API call fails for any reason.

lookupcaches.delete( _id )

Deletes the lookup cache associated with the given ID.

Arguments 

_id <String, required>

The ID of the lookup cache to delete.

Returns 

<Undefined>

Exceptions 

This function throws an error if the API call fails for any reason.

lookupcaches.getData( options )

Gets data from a lookup cache.

Arguments 

options <Object, required>

Contains the following properties:

  • _id <String, required> – The ID of the lookup cache to retrieve.

  • keys <Array, optional> – The keys to retrieve.

  • nextPageURL <String, optional> – The URL sent in the previous response.

  • pageSize <String, optional> – The page size can be provided only if keys are not provided.

Returns 

<Object>

An object that includes keys and values. The nextPageURL is shown as /v1/lookupcaches/:lookUpCache/getData?startAfterKey=<key>

Exceptions 

This function throws an error if the API call fails for any reason.

lookupcaches.putData( options )

Upserts data into a lookup cache.

Arguments 

options <Object, required>

Contains the following properties:

  • _id <String, required> – The ID of the lookup cache.

  • data <Array<Object>, required> - Data to upsert, that is keys and values.

Returns 

<Array>

An array that includes keys and their respective success and errors.

Exceptions 

This function throws an error if the API call fails for any reason.

lookupcaches.deleteData( options )

Deletes specific keys from a lookup cache.

Arguments 

options <Object, required>

Contains the following properties:

  • _id <String, required> – The ID of the lookup cache.

  • keys <Array, required> – Specific keys to be deleted.

Returns 

<Array>

An array that includes keys and their success.

Exceptions 

This function throws an error if the API call fails for any reason.

lookupcaches.purgeData( options )

Purges all data for a given lookup cache.

Arguments 

options <Object, required>

Contains the following property:

_id <String, required> – The ID of the lookup cache row

Returns 

<Undefined>

Exceptions 

This function throws an error if the API call fails for any reason.