REST API Analysis Export
This source is used to export analysis in Quant. You can export Category Opportunities analysis or Fixture Overview analysis. The input and output format is JSON.
Use the Automatic Tasks section to create and set up an export. Once created, the task list will have the ID that you pass in the request URL.
Settings
Before using the API, you must edit the following attributes in the Settings tab:
- Check the Enabled attribute to enable the task
- In the Users with API Access Permission, select one or more users with the Robot role who will have permission to run the task.
- In the Analyze attribute, select the ones you want to export.
- In the Opportunities / Fixture Analysis Attribute Mapping, select the attributes to export and optionally edit their JSON keys.
Attributes
Attribute | Description | Type |
Enabled | Specifies whether the user can access this resource. | yes/no |
Title | Custom name of the automated task. | text |
Description | Custom description of the automatic task function. | formatted text |
Notes | Notes. | long text |
Emails for Notifications | One or more email addresses to which emails with error conditions will be sent. | list of strings |
Users with API Access Permission | Users with the Robot role who are authorized to run the task. | list of users |
Delay in Seconds before Retrying | The number of seconds the client should wait before retrying the export in case of a long queue of requests to the server. | whole number |
Opportunities Analysis Attribute Mapping | A mapping containing an entry for each attribute to be exported. | complex type |
Fixture Analysis Attribute Mapping | A mapping containing an entry for each attribute to be exported. | complex type |
Measure Unit | Unit of measure such as cm, mm, etc. | selection |
Date Format | Date entry format, eg 31.12.19 | selection |
Date and Time Format | Date and time format, e.g. 31.12.19 23:59:59 | selection |
List Item Separator | Character for splitting the items of the list of values. | character |
Analyze | Analysis selection. | list of analysis |
Analysis Criteria | Selection of criteria settings according to which the analysis is to be exported. | complex type |
- Request
/v1/export/analyze-report/{task_id}
Parameter | Value |
URL | ?debug added to the URL will also display a warning in the response. Without it, only errors are listed. |
Header | Accept: application/json |
Header | Content-type: application/json |
Header (optional) | Accept-Encoding: gzip |
Header | Authorization: Bearer <TOKEN> TOKEN is obtained via /authenticate (see Login). |
Method | POST |
The content of the Fixture Overview analysis request is a JSON object containing the following keys:
Key | Value |
StoreIds | Within the request you need to specify for which store the product data is to be exported. It is always possible to select only one store. Examples: { "StoreIds":"12"} |
Response
Key | Value |
Status | A string describing the final state of the export.
|
Warnings | Optional - included only if the ?debug parameter is in the URL and the export generated at least one warning. List of warning strings. |
Errors | Optional - included only if the export generated at least one error. List of error strings. |
Record | Optional - is only included if the export did not end with a "FAILURE" status. List of exported objects. Each object contains the keys defined by the mapping in the task settings. |
Status Codes
Status | Value |
200 OK | Export successful with "SUCCESS" or "PARTIAL_SUCCESS" status. The response may contain warnings or minor errors. |
400 Bad Request | Incorrect task settings or incorrect request. |
401 Unauthorized | The authorization token is invalid, or the user who is logged on with the token does not have permission to run this task. |
404 Not Found | No task was found with the ID specified in the URL. |
500 Internal Server Error | A critical server-side error occurred during the export. |
503 Service Unavailable | Export is already running. Try running it again in the number of second specified in the Retry-After header. |
Execution Log
In Quant, in addition to task settings, you can also view records of individual exports, including statistics, errors, and warnings.
If we select a specific record, we can display its details by clicking the Show Items button.
Request for Category Opportunities
curl -X POST --location "http://[YOUR_COMPANY].iquant.eu/v1/export/analyze-report/117131?debug" \
-H "Authorization: Bearer ywJqq25pXO6oaCPqgEAiTioBVwM8Ih2kOwzzd3eWK3R2oDSA5n" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
Request for Fixture Overview
curl -X POST --location "http://[YOUR_COMPANY].iquant.eu/v1/export/analyze-report/117131?debug" \
-H "Authorization: Bearer ywJqq25pXO6oaCPqgEAiTioBVwM8Ih2kOwzzd3eWK3R2oDSA5n" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-d '[{ "StoreID": "12564"}]'
Response
{
"Status": "SUCCESS", "Records": [
{"Store ID": "234", "Store Name": "Kutná Hora", "City": "Kutná Hora", "Fixture type": "Freezer", "Number of Shelves": "5", "Category Name": "Doplňky", "Category Id": "CAT6"},
{"Store ID": "238", "Store Name": "Ostrava-Svinov", "City": "Ostrava", "Fixture type": "Default", "Number of Shelves": "6", "Category Name": "Yoga", "Category Id": "CAT931"},
{"Store ID": "545", "Store Name": "Kolín", "City": "Kolín", "Fixture type": "Default", "Number of Shelves": "6", "Category Name": "Milk", "Category Id": "CAT14"},
... ]
}