REST API Fixture Images Export
This source is used to extract data on fixture photos from Quant. It currently uses JSON as output.
The export can be accessed only by the Quant user with the Robot role, who has this Export enabled in the settings. Otherwise, the export will not be performed and the status attribute in the response will contain an error message:
HTTP 401 {"token":"<TOKEN>","status":"User is not authorized for this Resource."}
- Request
Parameter | Value |
URL | /equipmentImagesDataExport/json |
Debug | ?debug=true added to the URL will also display a warning in the response. Without it, only errors are listed. |
Header | Accept: application/json |
Header | Authorization: Bearer <TOKEN> TOKEN is obtained using /authenticate (see manual REST API Introduction and login). |
Method | GET |
- Attributes
Export settings are also specified on the user (see picture above).
Attribute | Description | Type |
Enabled | Specifies whether the user can access this resource. | yes/no |
Title | Custom resource name in Quant. | text |
Description | Description of the source function. | formatted text |
Notes | Notes. | long text |
Export Newer Items Than | Date limiting the list of exported images. When filled in, only images uploaded after this date will be exported. | date |
Include Annotations | If enabled, the image ID is exported, including custom adjustments, otherwise the original image ID without adjustment. | yes/no |
Maximum Planogram Image Width (px) | Specifies the maximum width of the planogram image to download in pixels. | positive integer |
Maximum Planogram Image Height (px) | Specifies the maximum height of the planogram image to download in pixels. | positive integer |
Date Format | Date entry format, eg 12/31/20. | selection |
- Response
Parameter | Value |
Body | {"token":"<TOKEN>","status":"<STATUS>,"Total Lines":<LINE_COUNT>,"Ignored Pictures":<IGNORED>," Records“:<RECORDS>,“Errors“:[ERRORS], “Warnings“:[WARNINGS]“} |
Attribute | Description | Type |
Token | User authorization token. | text |
Status | SUCCESS if all images in the selected time period were exported correctly, PARTIAL_SUCCESS if the export was successful, but some images were not exported and FAILURE in case of an unexpected error that stopped the export prematurely. | text |
Total Lines | Number of records on output. | number |
Ignored Pictures | The number of images that were not exported because they were not assigned to any equipment. | number |
Records | List of exported records. | JSON Array |
Errors | An array of JSON objects describing errors. If it is empty, it is not listed. | JSON Array |
Warnings | An array of JSON objects describing the warning (only if the request contained the parameter debug = true). If it is empty, it is not listed. | JSON Array |
- Execution Log
In Quant, in addition to the import settings on the Robot role, you can also view execution logs of individual exports, including statistics, errors, warnings and general information.
If you select a specific record, we can display its details by clicking the Show Items button (see picture below). After marking the selected items, click on Download Files. These files contain the output data for the given export run.
Request
curl -H "accept: application/json" -H 'Authorization: Bearer i37YKbgCnJSXe2nvIrHA1fE8bLIE4RqROu4l1AOTzHZXSmZ3CX' -G https://[YOUR_COMPANY].iquant.eu/equipmentImagesDataExport/json?debug=true
This example shows how to start exporting after previously getting TOKEN by logging in.
Response
{"token":"i37YKbgCnJSXe2nvIrHA1fE8bLIE4RqROu4l1AOTzHZXSmZ3CX","status":"SUCCESS","Total Lines":2,"Ignored Pictures":1,"Records": [{"EquipmentID":"b098ed39-f826-4827-aafa-acc85ebf6ee6","ID":"735076","Uploaded":"30.09.20","Uploaded By":"[Správce pobočky] jakab.t_det.store","Photo ID":"105","Implemented Planogram Id":"96444","Title":"","Description":""},{"EquipmentID":"2d212db0-0efd-4dfd-90a5-eac838d026d3","ID":"735075","Uploaded":"30.09.20","Uploaded By":"[Správce pobočky] jakab.t_det.store","Photo ID":"104","Implemented Planogram Id":"1578","Title":"","Description":""}], "Warnings":["Equipment Photo with ID '425742' has no equipment assigned."]}
This answer means a successful export with one warning. Details and statistics can then be found in Quant.
- Format of exported records
Each export record includes following items:
Name | Description | Type |
Equipment ID | ID of the equipment to which the image belongs. | text |
ID | Image ID. | text |
Uploaded | Image upload date. | date |
Uploaded By | User who uploaded the image. | text |
PhotoID | Photo download ID (see instructions below). | text |
Implemented Planogram Id | ID to download the image of planogram to which the photo belongs (see instructions below). If blank, the photo was not uploaded as an implementation photo. | text |
Title | Name of the image filled in by user. | text |
Description | Description of the image filled in by user. | text |
Download equipment photo
To download a photo of the equipment, we will use the item PhotoID from the selected export record.
- Request
Parameter | Value |
URL | /downloadImage/<PhotoID> |
Header | Authorization: Bearer <TOKEN> TOKEN is obtained using /authenticate (see manual REST API Introduction and login). |
Method | GET |
Request
curl -o image.jpg -H 'Authorization: Bearer i37YKbgCnJSXe2nvIrHA1fE8bLIE4RqROu4l1AOTzHZXSmZ3CX' -G https://[YOUR_COMPANY].iquant.eu/downloadImage/105
Response
A binary JPEG image.
Download planogram photo
To download the planogram image, use the Implemented Planogram Id item from the selected export record.
- Request
Parameter | Value |
URL | /downloadPlanogramImage/<PlanogramID> |
Header | Authorization: Bearer <TOKEN> TOKEN is obtained using /authenticate (see manual REST API Introduction and login). |
Method | GET |
Request
curl -o planogram.jpg -H 'Authorization: Bearer i37YKbgCnJSXe2nvIrHA1fE8bLIE4RqROu4l1AOTzHZXSmZ3CX' -G https://[YOUR_COMPANY].iquant.eu/downloadPlanogramImage/96444>
Response
A binary JPEG image with measurements that fit within the limits set in the export settings.