Bulk Import of Collections
The custom collection elements in Xurrent are often lists of data managed in other systems that you want to import on a regular basis in Xurrent.
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:
- Custom Collections: it_bulk_import_custom_collections.csv
- Custom Collection Elements: it_bulk_import_custom_collection_elements.csv
Exercises:
Can you import the Custom Collection Elements in the Widget Data Center (id = wdc) account?
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-Xurrent-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-Xurrent-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-Xurrent-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.