In some cases, managing product images one by one through the Scantrust platform UI can become time-consuming, especially when dealing with a large number of products. To simplify this process, Scantrust offers the option to upload product images in bulk via the command line using API endpoints.
This approach is ideal for:
-
Large product catalogs
-
Initial onboarding of product images
-
Periodic updates of product galleries
In this article, we will guide you step-by-step on how to prepare your files, authenticate to the API, and upload your product images efficiently using simple command-line operations.
NOTE: This tool is a non-UI tool and can only be run via the command line (terminal/cmd)
Here, some important facts to be aware of before:
1. Have the SKU list - product SKU on the Scantrust system
2. Have the images ready - local image file name:
3. Excel file filled:
The upload CSV file should contain (template attached at the end of this article)
Note: Max image size = 10MB, supported format: jpeg, png.
Image Sync Script Beginner Instructions
MAC Users
1. Use the Image sync tool to upload product images in bulk. For downloads and detailed info, please refer to the link.
1. Open Terminal
2. Type 'cd /your folder location’ and press Enter - how to find the location of your file
cd /Users/[Your User]/Documents/product_image_upload
3. Now you are located in the folder with every file you need
4. The next step is to enter the command to :
-
- Select the tool ./image_sync
- Log in to Scantrust --server api.scantrust.com
- User email --user youremail@address.com
- Password --password yourpassword
- Select the CSV file --yourcsvfile.csv
5. Type all of them in one line and press Enter
./image_sync --server api.scantrust.com –-user youremail@address.com --password yourpassword yourcsvfile.csv
6. You will see:
7. Type r and press Enter to start uploading:
Windows Users
Important:
- You need to gather all the files you need in one folder. This article will assume that you put all the files on your Desktop in a folder called: image_sync-0.0.2 .
- The CSV file with the template that you want to upload (we call it template.csv in this article)
- Please make sure you disable your antivirus provider temporarily before running the app.
- Please make sure that the product and the SKU number are well set in our portal. Otherwise, please check this article: Adding a Product Manually.
1. Please download our image sync tool from this link: https://devportal.scantrust.com/docs/scantrust/tools-and-integrations/image-sync
2. Please select the option labeled as: "Windows 7+ 64bit":
3. You will receive a zip file containing the following files:
4. Please, run CMD app as an admin on your computer.
5. Using the following line, type your folder location and press Enter:
cd Users\[your user name]\[File Location]\[File Folder]
Example:
C:\Users\[Your User name]>cd Desktop\image_sync-0.0.2
C:\Users\[Your User name]\Desktop\image_sync-0.0.2>
6. Now you are located in the folder with every file you need. If you want to confirm what files are included in that folder, please type the following:
Users\[your user name]\[File Location]\[File Folder]> dir
7. Then, you should be able to see the following:
C:\Users\[Your User name]\Desktop\image_sync-0.0.2>dir
Directory of C:\Users\[Your User name]\Desktop\image_sync-0.0.2
29/06/2022 10:02 a. m. <DIR> .
10/08/2022 01:46 p. m. <DIR> ..
24/09/2019 04:14 p. m. 6.578.488 image_sync.exe
24/09/2019 03:47 p. m. 1.869 README.md
29/06/2022 10:08 a. m. 45 templateSyncImages.csv
29/06/2022 10:08 a. m. 19 templateSyncImages.csv.log
23/06/2022 10:21 a. m. 18.845 test.jpg
5 files 6.599.266 bytes
2 dirs 370.317.910.016 bytes libres
8. Once you are located in the folder, the next step is to enter into the command line, the following information:
- Select the tool: >image_sync
- Select the CSV file: yourcsvfile.csv
- log in to Scantrust Server: api.scantrust.com
- User email: youremail@address.com
- Password: yourpassword
9. Type all of them in a single line and then press Enter:
Users\[your user name]\[File Location]\[File Folder]>image_sync.exe [yourcsvfile.csv] --server api.scantrust.com –-user [youremail@address.com] --password [your password]
10. Once you press ENTER, you will see:
C:\Users\[Your User name]\Desktop\image_sync-0.0.2>image_sync.exe templateSyncImages.csv --server api.staging.scantrust.io --user YourUser@address.com --password [your password]
==============================================================
Running utility with these settings
Server api.staging.scantrust.io
Username/token nxxxxxxxs@scantrust.com
Input File templateSyncImages.csv
Log File templateSyncImages.csv.log
Verbose Logging False
==============================================================
Logged in as Nxxxxxxxxxxs
Logged in to https://api.staging.scantrust.io as nxxxxxxxxs@scantrust.com
--------------------------------------------------------
LOG FILE EXISTS: templateSyncImages.csv.log (0 rows already processed).
r: run with existing logfile
d: delete logfile and process all items
x: exit
-------------------------------------------------------
What would you like to do?:
11. Finally, please type r, and press ENTER, The app will upload the number of images in bulk as you indicated previously in the CSV file and will show the following message:
What would you like to do?: r
Continue uploading using the logfile, previously uploaded items will not be processed.
Syncing 1 images [####################################] 100%
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 Images where uploaded on the system.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comments