Bulk Import of Collections
Integrations Bulk API Training Bulk API

Bulk Import of Collections

The custom collection elements in 4me are often lists of data managed in other systems that you want to import on a regular basis in 4me.
In the following exercise you will load Cost Centers as Custom Collection Elements in the Widget Data Center account.

For this exercise we have prepared two import files:

  1. Custom Collections: it_bulk_import_custom_collections.csv
  2. Custom Collection Elements: it_bulk_import_custom_collection_elements.csv


Copy the custom collections import file to /tmp/it_bulk_import_custom_collections.csv and upload the file with:

curl -X POST -i -H "Authorization: Bearer <personal-token>" -H "X-4me-Account: wdc" -F type=custom_collections -F "file=@/tmp/it_bulk_import_custom_collections.csv" "https://api.4me-demo.com/v1/import"

Make sure the custom collections upload has finished using the token (something like ‘68ef5ef0…db41e68’) received after the previous call:

curl -X GET -i -H "Authorization: Bearer <personal-token>" -H "X-4me-Account: wdc" "https://api.4me-demo.com/v1/import/68ef5ef0...db41e68"

Then copy the custom collection elements file to /tmp/it_bulk_import_custom_collection_elements.csv and upload the file with:

curl -X POST -i -H "Authorization: Bearer <personal-token>" -H "X-4me-Account: wdc" -F type=custom_collection_elements -F "file=@/tmp/it_bulk_import_custom_collection_elements.csv" "https://api.4me-demo.com/v1/import"

Remark: in the previous exrcise you have imported the custom collection with a bulk import API command. In reality it are probably only the custom collection elements that will be loaded with the Bulk Import API.