# Assign documents to a channel's classifications

By
The Quable Team

As you set up your channel for the first time, you may need to load hundreds or thousands of documents into the channel's classifications.
If you have chosen not to use automatic assignments (via searches), assignment is manual.
In this case, 2 methods are possible:

  • assignment via interface (one document at a time)
  • assignment via API

The associated script will allow you to create each manual assignment via API based on a CSV file containing each document code and classification code.


# Example of CSV file

classification_code,document_code
eco_women,document_trouser_black
eco_men,document_trouser_blue_man
eco_men,document_trouser_red_man
eco_women,document_trouser_blue

# Example of python script

You can access a Python example on Github here

Script can be executed this way

    python3 ./assign-documents-to-channel.py9.py \
        --pim_instance=MY-INSTANCE \
        --api_token=MY-TOKEN \
        --csv_file=MY-FILE.csv