/
Data import via API

Data import via API

You can use the API to import and update digital data in your Wizart Visualizer as an alternative to the manual upload (through the UI). In this case, every time you upload new product items/collections to your store, they will be automatically added to the Visualizer.

Links to check:

If you need some special API endpoint, please, check Another API methods.

Importing data via API

Please note, that for all API calls you have to use the access_token. From API authentication and authorizationarchived

Steps 1, 2, 3 describe the order of actions which you have to do to import products in PIM system.

First of all you have to select which product type you will import. After that you need obtain a data mapping by selected product type and finally send product data to the PIM

1. Get all product types

Method: GET

URL: https://pim-client.wizart.tech/api/v2/import/product-types

Headers: Accept: application/json, Authorization: Bearer eyJ0eXAiOiJ…

{ "data": [ { "type": "product_type", "uuid": "9b9a564f-2ae4-421a-b333-2e2a0701be22", "attributes": { "code": "wallpaper", "name": "Wallpaper" } }, { "type": "product_type", "uuid": "e81cd032-78ab-4471-9bba-c400dc4a24d4", "attributes": { "code": "carpet_roll", "name": "Carpet flooring in rolls" } }, { "type": "product_type", "uuid": "2503e654-2cbd-48f2-9cfe-8f917e6c0f38", "attributes": { "code": "tile", "name": "Tile" } }, { "type": "product_type", "uuid": "6775b058-6653-4202-ac50-438ea1c54ff7", "attributes": { "code": "laminate", "name": "Laminate" } }, { "type": "product_type", "uuid": "0f8f9abd-a9ee-43d3-8efd-c1571a9caa01", "attributes": { "code": "carpet_tile", "name": "Carpet flooring in tiles" } } ] }

2. Get default mapping CSV

This endpoint you can use in order to obtain an example of csv file to fill your data.

Method: GET

URL: https://pim-client.wizart.ai/api/v2.1/data-mappings/default/{product_type_code}

Headers: Accept: text/csv, Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG…

3. Upload new import

data:

archive:

Method: POST

URL: https://pim-client.wizart.ai/api/v2.1/product-type/{productTypeCode}/import

Authorization: Type: Bearer Token, Token: Bearer eyJ0eXAiOiJKV…

Headers: Accept: application/json,Content-Type: multipart/form-data

We used mapping_id (58) which we obtained from paragraph 3.4.

 

{ "data": [ { "type": "<string>", "id": "<string>", "attributes": { "path": "<string>", "original_name": "<string>", "status": "<string>", "status_message": "<string>", "result": "<string>", "mapping_id": "<string>", "created_at": "<string>", "updated_at": "<string>", "timezone": "<string>" } }, { "type": "<string>", "id": "<string>", "attributes": { "path": "<string>", "original_name": "<string>", "status": "<string>", "status_message": "<string>", "result": "<string>", "mapping_id": "<string>", "created_at": "<string>", "updated_at": "<string>", "timezone": "<string>" } } ] }

The result to be seen on the PIM admin panel upon successful completion