Articles in this section

Retrieve the resource ID

Many functions in the integrator-api module take an _id — either as the only argument or as a property of an options object. The _id is the identifier integrator.io assigns to a resource when you create it, and the fastest place to find it is your browser's address bar while you have the resource open.

This article shows how to read an ID out of the URL. It applies to integrations, flows, connections, exports, and imports.

Find an ID in the URL

integrator.io exposes resource IDs in the address bar. Open the resource — for example, select an export to open the Edit export panel — and read the URL:

https://integrator.io/integrations/5c1•••••f4f/flowBuilder/5c6••••••39c/edit/exports/5c6••••••3fb

Each bolded segment names a resource type, and the value immediately after it is that resource's ID. The URL above contains three IDs: the integration, the flow, and the export.

Copy the full value after the slash for the resource type you need. To use the export from the URL above in a script:

exports.run({ _id: '5c6••••••••••••••••••3fb' })

IDs in Celigo documentation are masked with bullet characters (5c6••••••3fb). Your own IDs are full-length strings with no bullets.

Consider an alias instead

An ID is specific to one resource in one account. If you clone a flow, download an integration and install it elsewhere, or build a template, the IDs change and any script that hard-codes them stops pointing at the right resource.

Aliases solve this. You assign a name to a connection, export, import, or flow, and reference the name in your script instead of the ID. For how to set one up, see Create and manage aliases to reference resources in scripts. For how to use one in a script or custom form, see Reference resource aliases in hooks, custom forms, and connection routes.

Aliases require the flow to belong to an integration, and they apply only to scripts and hooks that use supported JavaScript runtime functions.

Find a resource by external ID

To retrieve a resource without knowing its ID, assign it a custom externalId when you create it, then search for that value:

exports.find({ externalId: 'daily_order_export' })

externalId is the only property the find() query object supports.