Imports API

Introduction

Included is a step by step guide to importing entity model (e.g. products, stores, etc.) or data source information from a .CSV file via Intilery’s RESTful API. Note: All CSV Data sources must be keyed off of a column designated “key”.

Contact your account manager for your account-specific settings:

  • Rest Host
  • Account 
  • API Authorization Key
  • API Username
  • API User Password

Model Import

1. Initialize Import

Request:

Method: POST

URL: https://<Rest_Host >/rest/upload/model/<Model>

Headers:  Authorization: Basic <API AUTHORIZATION KEY>

Body: N/A

Expected Response

Headers: N/A

Body: {"id": Import_ID, "modelOf": “Your_Model”}


2. Intilery Sign In

Request

Method: GET

URL: https://<Rest_Host>/rest/security/sign-in

HEADERS:  Authorization: Basic <API AUTHORIZATION KEY> 

BODY: N/A

Expected Response

HEADERS: set-cookie: JSESSIONID=Your_Session_ID;

3. File Upload 

Request

Method: POST

URL: https://<Rest_Host>/upload/model/ >

HEADERS: Content-Type: ‘multipart/form-data’; Cookie: JSESSIONID=<Your_Session_ID>;

BODY: uploadedFile:<Your_CSV>

Expected Response

HEADERS: N/A

BODY: N/A


4. Trigger Import

Request

Method: POST

URL: https://<Rest_Host>/rest/upload/model/<Import_ID>

HEADERS: Content-Type: ‘multipart/form-data’; Cookie: JSESSIONID=<Your_Session_ID>;

BODY: {"modelOf": "<Model>", "id": "<Import_ID>"}

Expected Response

HEADERS: N/A

BODY: {"id": "<Job_ID>"}

5. Trigger Data Upload 

Request

Method: GET

URL: https://<Rest_Host>/rest/jobs/<Job_ID>

HEADERS: N/A

BODY: N/A

Expected Response:

HEADERS:  N/A
BODY: { "id": "13b88fbb-4598-4bcd-ac6c-29f89a067cb1","accountID": 25,"name": "Import Models","percentComplete": 100,"countTasks": 0,"jobState": "PENDING"...}

Data Source Import

1. Initialize Import

Request:

Method: POST

URL: https://<Rest_Host> /rest/upload/model/ data-source-csv

Headers:  Authorization: Basic <API AUTHORIZATION KEY>

Body: No Content

Expected Response

Headers: N/A

Body: {"id": Import_ID, "modelOf": data-source-csv”}


2. Intilery Sign In

Request

Method: GET

URL: https://<Rest_Host>/rest/security/sign-in

HEADERS:  Authorization: Basic <API AUTHORIZATION KEY>

BODY: No Content

Expected Response

HEADERS: set-cookie: JSESSIONID=Your_Session_ID;

3. File Upload 

Request

Method: POST

URL: https://<Rest_Host>/upload/model/<Import_ID>

HEADERS: Content-Type: ‘multipart/form-data’; Cookie: JSESSIONID=<Your_Session_ID>;

BODY: uploadedFile:<Your_CSV>

Expected Response

HEADERS: N/A

BODY: N/A

4. Trigger Import

Note: Your data source ID can be found on the data sources page of your Intilery settings.

Request

Method: POST

URL: https://<Rest_Host>/rest/upload/model/<Import_ID>/<Data_Source_ID>

HEADERS: Content-Type: ‘multipart/form-data’; Cookie: JSESSIONID=<Your_Session_ID>;

BODY: N/A

Expected Response

HEADERS: N/A

BODY: {"id": "<Job_ID>"}

5. Trigger Data Upload 

Request

Method: GET

URL: https://<Rest_Host>/rest/jobs/<Job_ID>

HEADERS: N/A

BODY: N/A

Expected Response:

HEADERS:  N/A
BODY: {"id": "13b88fbb-4598-4bcd-ac6c-29f89a067cb1","accountID": 25,"name": "Import Models","percentComplete": 100,"countTasks": 0,"jobState": "PENDING"...}

Still need help? Contact Us Contact Us