Download integrator.io Postman collection
Contents
Import API endpoints
Relative URI | Method | Success code | Description |
/imports | GET | 200 | Get all imports. |
POST | 201 | Create an import. | |
/imports/<_id> | GET | 200 | Get a specific import. |
PUT | 200 | Update a specific import. | |
DELETE | 204 | Delete a specific import. | |
/imports/<_id>/clone | POST | 201 | Clone a specific import. |
/imports/<_id>/audit | GET | 200 | Get a log for a specific import. |
/imports/<_id>/invoke | POST | 200 | Invoke an import. Data and settings can be passed as an array in the request body to invoke the import. |
Import API examples
GET /v1/imports/594••••••••••••••••••662 HTTP/1.1
Host: api.integrator.io
Authorization: Bearer my_api_token
Sample Response:
{ "_id":"594••••••••••••••••••662", "lastModified":"2017-11-28T18:38:19.851Z", "name":"Upload File to FTP Site", "_connectionId":"56f••••••••••••••••••77d", "distributed":false, "apiIdentifier":"ib8f75140f", "file":{ "skipAggregation":false, "type":"csv", "csv":{ "rowDelimiter":"\n", "columnDelimiter":",", "includeHeader":false, "wrapWithQuotes":false, "replaceTabWithSpace":false, "replaceNewlineWithSpace":false } }, "ftp":{ "directoryPath":"/test", "fileName":"file-{{timestamp}}.csv" }, "mapping":{ "fields":[ { "extract":"internal_id", "generate":"id" }, { "extract":"item_id", "generate":"sku" }, { "extract":"name", "generate":"name" }, { "extract":"sales_description", "generate":"description" }, { "extract":"rate", "generate":"price" }, { "extract":"qty_on_hand", "generate":"qty" } ] } }
This example demonstrates changes to the import shown above in the GET example.
PUT /v1/imports/594••••••••••••••••••662 HTTP/1.1
Host: api.integrator.io
Authorization: Bearer my_api_token
{ "_id":"594••••••••••••••••••662", "lastModified":"2017-06-23T17:31:04.446Z", "name":"Upload File to FTP Site (updated!)", "_connectionId":"56f••••••••••••••••••77d", "distributed":false, "apiIdentifier":"ib8f75140f", "file":{ "skipAggregation":false, "type":"csv", "lookups":[ ], "csv":{ "rowDelimiter":"\n", "columnDelimiter":",", "includeHeader":false, "wrapWithQuotes":false, "replaceTabWithSpace":false, "replaceNewlineWithSpace":false } }, "ftp":{ "directoryPath":"/test", "fileName":"file-{{timestamp}}.csv" }, "mapping":{ "fields":[ { "extract":"internal_id", "generate":"updated_id" }, { "extract":"item_id", "generate":"sku" }, { "extract":"name", "generate":"name" }, { "extract":"sales_description", "generate":"description" }, { "extract":"rate", "generate":"price" }, { "extract":"qty_on_hand", "generate":"qty" } ] } }
Sample response
{ "_id":"594••••••••••••••••••662", "lastModified":"2017-11-28T18:47:09.553Z", "name":"Upload File to FTP Site (updated!)", "_connectionId":"56f••••••••••••••••••77d", "distributed":false, "apiIdentifier":"ib8f75140f", "file":{ "skipAggregation":false, "type":"csv", "csv":{ "rowDelimiter":"\n", "columnDelimiter":",", "includeHeader":false, "wrapWithQuotes":false, "replaceTabWithSpace":false, "replaceNewlineWithSpace":false } }, "ftp":{ "directoryPath":"/test", "fileName":"file-{{timestamp}}.csv" }, "mapping":{ "fields":[ { "extract":"internal_id", "generate":"updated_id" }, { "extract":"item_id", "generate":"sku" }, { "extract":"name", "generate":"name" }, { "extract":"sales_description", "generate":"description" }, { "extract":"rate", "generate":"price" }, { "extract":"qty_on_hand", "generate":"qty" } ] } }
POST /v1/import/55e••••••••••••••••••366/invoke HTTP/1.1 Host: api.integrator.io Authorization: Bearer my_api_token
Sample response
[ { "statusCode": 200, "_json": {} }, { "statusCode": 200, "_json": {} } ]
Pass data and settings
If you want to pass settings along with data in an import, you must wrap the details in individual data and settings JSON objects.
Comments
0 comments
Please sign in to leave a comment.