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 |
(Scriptable objects) |
|
(Scriptable objects) |
|
(Scriptable objects) |
|
(Scriptable objects) |
|
This runtime object represents one or more exports in your account and allows you to access them via script.
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. |
Returns <Array> |
An array of exports. |
Exceptions |
This function throws an error if the API call fails for any reason. |
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. |
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. |
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. |
Patches the export, updating only the specific fields and values provided.
Argument options <Object, required> |
Contains the following properties:
|
Returns <Undefined> |
|
Exceptions |
This function throws an error if the API call fails for any reason. |
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. |
Runs the export associated with the given ID.
Argument options <Object, required> |
Contains the following properties:
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:
|
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}) } } }
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:
|
Returns <Object> |
The response object has the following properties:
|
Exceptions |
This function throws an error if the API call fails for any reason. |
Examples: Run a virtual export in JavaScript APIs
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:
|
Returns <Object> |
The response object has the following properties:
|
Exceptions |
This function throws an error if the API call fails for any reason. |
The imports object represents one or more imports found in your account and allows you access to them via script.
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. |
Returns <Array> |
An array of imports. |
Exceptions |
This function throws an error if the API call fails for any reason. |
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. |
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. |
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. |
Patches the import, updating only the specific fields and values provided.
Argument options <Object, required> |
Contains the following properties:
|
Returns <Undefined> |
An object representing the updated import. |
Exceptions |
This function throws an error if the API call fails for any reason. |
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. |
Runs the import associated with the ID provided.
Argument options <Object, required> |
Contains the following properties:
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:
|
Exceptions |
This function throws an error if the API call fails for any reason. |
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:
|
Returns <Array> |
Each response array has the following properties:
|
Exceptions |
This function throws an error if the API call fails for any reason. |
Runs the mapping instructions only within a virtual import.
Argument options <Object, required> |
Contains the following properties:
|
Returns <Array> |
Each response array has the following properties:
|
Exceptions |
This function throws an error if the API call fails for any reason. |
The flows object represents one or more flows found in your account and allows you access to them via script.
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. |
Returns <Array> |
An array of flows. |
Exceptions |
This function throws an error if the API call fails for any reason. |
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. |
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. |
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. |
Patches the flow, updating only the specific fields and values provided.
Argument options <Object, required> |
Contains the following properties:
|
Returns <Undefined> |
|
Exceptions |
This function throws an error if the API call fails for any reason. |
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. |
Runs the flow associated with the ID provided.
Argument options <Object, required> |
Contains the following properties:
|
Returns <Object> |
An object representing the flow run status. |
Exceptions |
This function throws an error if the API call fails for any reason. |
The connections object represents one or more connections found in your account and allows you access to them via script.
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. |
Returns <Array> |
An array of connections. |
Exceptions |
This function throws an error if the API call fails for any reason. |
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. |
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. |
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. |
Patches the connection, updating only the specific fields and values provided.
Argument Options <Object, required> |
Contains the following properties:
|
Returns <Undefined> |
|
Exceptions |
This function throws an error if the API call fails for any reason. |
An integration object allows you to find, modify, or remove an existing integration in your account.
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. |
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. |
The accessTokens object represents the access tokens available in your account.
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. |
Returns <Array> |
An array of access tokens. |
Exceptions |
This function throws an error if the API call fails for any reason. |
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. |
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. |
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. |
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. |
The async helpers object represents one or more async helpers found in your account and allows you access to them via script.
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. |
Returns <Array> |
An array of Async Helpers. |
Exceptions |
This function throws an error if the API call fails for any reason. |
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. |
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. |
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. |
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. |
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.
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. |
Returns <Array> |
An array of file definitions. |
Exceptions |
This function throws an error if the API call fails for any reason. |
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. |
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. |
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. |
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.
Retrieves all resource-specific keys.
Argument options <Object, required> |
Contains the following properties:
|
Returns <Object> |
An object containing all keys. |
Exceptions |
This function throws an error if the API call fails for any reason. |
Retrieves the value associated with a resource-specific key.
Argument options <Object, required> |
Contains the following properties:
|
Returns <Object> |
The value associated with the key. |
Exceptions |
This function throws an error if the API call fails for any reason. |
Updates the value for a resource-specific key.
Argument options <Object, required> |
Contains the following properties:
|
Returns <Undefined> |
|
Exceptions |
This function throws an error if the API call fails for any reason. |
Deletes a resource-specific key and value.
Argument options <Object, required> |
Contains the following properties:
|
Returns <Undefined> |
|
Exceptions |
This function throws an error if the API call fails for any reason. |
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 can access or edit lookup cache data via hook scripts only when the lookup cache is used in any of the mappings in a flow step within an integration and therefore associated with the integration.
Associate a lookup cache with an integration: If your lookup cache is not yet associated with an integration, that is used/referenced in a flow step within an integration, then you can create a dummy export or import step in the integration, and map a field using that lookup cache in Transformation 2.0 or Mapper 2.0. Now, an association is established between the lookup cache and integration, and you can use hook scripts to access or edit the lookup cache data.
Finds lookup caches matching the query. If no query is provided, then this function returns all lookup caches accessible to the script.
Arguments
|
A simple object containing the key-value pairs representing your search criteria. If query is provided, it can include only the following property:
|
Returns <Array> |
An array of lookup caches. |
Exceptions |
This function throws an error if the API call fails for any reason. |
Returns the lookup cache associated with the given ID.
Arguments
|
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. |
Creates a lookup cache.
Updates the specified lookup cache.
Patches the lookup cache, updating specific fields and values.
Arguments
|
Contains the following properties:
|
Returns <Undefined> |
|
Exceptions |
This function throws an error if the API call fails for any reason. |
Deletes the lookup cache associated with the given ID.
Arguments
|
The ID of the lookup cache to delete. |
Returns <Undefined> |
|
Exceptions |
This function throws an error if the API call fails for any reason. |
Gets data from a lookup cache.
Arguments
|
Contains the following properties:
|
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. |
Upserts data into a lookup cache.
Arguments
|
Contains the following properties:
|
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. |
Deletes specific keys from a lookup cache.
Arguments
|
Contains the following properties:
|
Returns <Array> |
An array that includes keys and their success. |
Exceptions |
This function throws an error if the API call fails for any reason. |
Purges all data for a given lookup cache.
Arguments
|
Contains the following property: • |
Returns <Undefined> |
|
Exceptions |
This function throws an error if the API call fails for any reason. |