Articles in this section

Import API endpoints

download.svg​​ Download Postman collection

Understand and create imports

imports.run( options )

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.

PATCH

204

Update part of 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.

/imports/<_id>/replaceConnection

PUT

200

Replace the import's connection.

/imports/<_id>/dependencies

GET

200

Get all resources using or used by this import.

The following fields are available to update when using PATCH:

Field

Data type

debugUntil

date

assistantMetadata

mixed

Import API examples

Get a specific import

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"
      }
    ]
  }
}

Update an import to change the name and one of the field mappings

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"
      }
    ]
  }
}

Update an import to change the name and one of the field mappings

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": {}
     }
]
Row 10.png

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.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.