Processing images uploaded via ftp

Function catalog/processImages (http://<DOMAIN>/api/catalog/processImages/)

Processing of images uploaded via ftp to the directory /content/import_images/

Parameters:

  • token - authorization key obtained via auth function
  • removePrevImages - BOOL need to remove previous images in the product

Response:

  • status - status of the function execution
    • OK - all records were updated successfully
  • response.log - log of function execution for each record
    • response.log[i].fileName - name of the processed file
    • response.log[i].code - code of image addition status
      • 0 - No errors
      • 1 - Incorrect file extension
      • 2 - Item by specified article is missing
      • 3 - Error when moving the image
      • 4 - Gallery with the specified name is missing
    • response.log[i].message - status explanation


Query example http://<DOMAIN>/api/catalog/processImages/

{
  "token": "9948039e94ff867ecc75051bf99f12c6",
  "removePrevImages": true
}

Response example

{
  "status": "OK",
  "response": {
    "log": [
      {
        "fileName": "123123.jpg",
        "code": 0,
        "message": "File 123123.jpg added to 123123 (gallery: images)"
      },
      {
        "fileName": "123123@1.jpg",
        "code": 0,
        "message": "File 123123@1.jpg added to 123123 (gallery: images)"
      },
      {
        "fileName": "123123@gallery_common@1.jpg",
        "code": 0,
        "message": "File 123123@gallery_common@1.jpg added to 123123 (gallery: gallery_common)"
      },
      {
        "fileName": "123123@gallery_common@2.jpg",
        "code": 0,
        "message": "File 123123@gallery_common@2.jpg added to 123123 (gallery: gallery_common)"
      },
      {
        "fileName": "afas32352.jpg",
        "code": 0,
        "message": "File afas32352.jpg added to afas32352 (gallery: images)"
      },
      {
        "fileName": "afas32352@gallery_360@1.jpg",
        "code": 0,
        "message": "File afas32352@gallery_360@1.jpg added to afas32352 (gallery: gallery_360)"
      },
      {
        "fileName": "afas32352@gallery_360@2.jpg",
        "code": 0,
        "message": "File afas32352@gallery_360@2.jpg added to afas32352 (gallery: gallery_360)"
      },
      {
        "fileName": "afas32352@gallery_comasdgagasgmon@3.jpg",
        "code": 4,
        "message": "Gallery gallery_comasdgagasgmon does not exists"
      },
      {
        "fileName": "afas32352@gallery_common@3.jpg",
        "code": 0,
        "message": "File afas32352@gallery_common@3.jpg added to afas32352 (gallery: gallery_common)"
      },
      {
        "fileName": "asdgasdgasd325235235.jpg",
        "code": 2,
        "message": "Product with article asdgasdgasd325235235 does not exists"
      }
    ]
  }
}