Runs the export associated with the given ID.
Applies to
My APIs > integrator.io API runtime object > exports
Argument
options <Object, required>
Contains the following properties:
_id <String, required>
– the ID of the export to runstartDate <Date>
– start date for delta exports as a Date objectendDate <Date>
– end date for delta exports as a Date objectdata <Array / Object>
- data to pass to exportsettings <Object>
- settings to pass to exportlistenerData <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 configurationerrors <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})
}
}
}
Comments
0 comments
Please sign in to leave a comment.