REST API Fixture Product Reservation Export V1
This resource is used to export fixture product reservation in Quant. The input and output format is JSON.
Use the Automatic Tasks dialog 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 Reservation Attribute Mapping, Product Attribute Mapping, Store Attribute Mapping, and Fixture Type Attribute Mapping rows, select the attributes to export and optionally modify their JSON keys.
Attributes
Attribute | Description | Type |
Enabled | Specifies whether the automated task is active and can send data through it. | 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 | In the case of status code 503, the client should retry to send the request in that many seconds. | number |
Reservation Attribute Mapping | A mapping containing an entry for each fixture reservation attribute to be exported. | complex type |
Product Attribute Mapping | A mapping containing an entry for each product attribute to be exported. | complex type |
Store Attribute Mapping | A mapping containing an entry for each store attribute to be exported. | complex type |
Fixture Type Attribute Mapping | A mapping containing an entry for each fixture type 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 entry format and time, eg. 31.12.19 23:59:59 | selection |
List Item Separator | Symbol for splitting items in the list of values. | symbol |
Request
/v1/export/fixture-product-reservations/{id_ulohy}
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 | Authorization: Bearer <TOKEN> TOKEN is obtained using /authenticate (see Login). |
Method | POST |
The content of the request can be omitted (empty text), or it can be an empty JSON object.
The content of the request is a JSON object containing these keys:
Key | Value |
ReservedBy | A separate string or array of strings specifying which reservations of which user are to be exported. If an empty value is sent, all reservations will be exported. Examples: { "ReservedBy": [] } { "ReservedBy": ["test.rehorova.cz.extech.sk"] } |
Response
Key | Value |
Status | A string describing the final state of the export.
|
Warnings | It is optional, ie. is 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. |
Records | Optional - is included only if the export did not end with the status "FAILURE". List of exported objects. Each object contains keys defined by mapping in the job 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. |
403 Reservations Not Enabled | Reservations are not available for this company. |
500 Internal Server Error | A critical server-side error occurred during the export. |
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 on Show Items button.
Request
curl -X POST --location "http://[VASE_SPOLECNOST].iquant.eu/v1/export/fixture-product-reservations/246?debug" \
-H "Authorization: Bearer ywJqq25pXO6oaCPqgEAiTioBVwM8Ih2kOwzzd3eWK3R2oDSA5n" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-d '{ "ReservedBy": ["test.rehorova.cz.extech.sk","quant.customer"] }'
Response
{
"Status": "SUCCESS",
"FixtureTypes": {
"357888": {
"Name": "Freezer",
"Monthly fee": 500 },
"568836": {
"Name": "Fixture 6 shelves",
"Monthly fee": 200 }
},
"Products": {
"718234": {
"Primary Id": "971070800",
"Product name": "",
"Name of supplier": "",
"ISupplier ID": "" },
"720552": {
"Primary Id": "970518320",
"Product name": "",
"Name of supplier": "",
"Supplier ID": "" },
},
"Stores": {
"169": {
"Store name": "Čáslav",
"Store ID": "198",
},
"Records": [ {
"Status": "Waiting for Approval",
"Reserved by user": "test.rehorova.cz.extech.sk",
"Year": 2023,
"Month": 10,
"Note": "PAVLA test2",
"Products": [ "721884", "720552" ],
"Store QID": "663097",
"Fixture Type QID": "701386",
"Equipment fee": 1000 }
...]
}