REST API Introduction and login
Request
Requests must be sent using HTTPS. All URLs begin with the assigned address. In this documentation, we will state:https://[YOUR_COMPANY].iquant.eu.
Please contact Quant Support for your URL address.
Supported formats
The API currently supports JSON and SVG formats according to the type of request.
If you use another format, you will receive a response from the server HTTP 415 Unsupported Media Type.
Error handling
If the API is temporarily unavailable, the error response will be 5XX. It is the client's responsibility to retry the request in this case.
Login
Login is required to communicate with the API. In response to the login, you will receive a token that you will use for further requests. The token will be valid for 30 minutes. When the token expires, you will need to log in again to get a new token.
You must log in using the Robot user role that you create in Quant.
- REST Request:
Parameter | Value |
URL | /authenticate |
Header | Accept: application/json |
Header | Content-type: application/json |
Method | POST |
Payload | {"username":"<username>","password":"<password>"} |
- REST Response:
Parameter | Value |
Body | {"token":"<token>","status":"<result>"} |
If the login is successful, you will receive a response: HTTP 200. You will receive an authentication token in the response. Otherwise, the status attribute in the response will contain an error message, for example:
HTTP 401 {"token":"","status":"Wrong username or password!"}"
Login to REST API
Request
curl -H 'accept: application/json' -H 'content-type: application/json' "https://[YOUR_COMPANY].iquant.eu/authenticate" -d '{"username":"xxxx","password":"xxxx"}'
Response
{"token":"nAti4s84yqxmgcOf16IOmp4NwLaJV7kJIoGFnzTDrra0JSEG02","status":"SUCCESS"}
Authorization
Authorization is performed using a token attached to the HTTP header.
Parameter | Value |
Header | Authorization: Bearer <TOKEN> |
If the token is already invalid, you will receive a response:
HTTP 401 Unauthorized Content-Type: text/plain Body:"Token is missing or invalid!"
curl -H 'accept:application/svg+xml' -H 'Authorization: Bearer cDEHSUb03G8SJIAtHRYHYVeCmcxKxLDkVaUrhtBNGBSZpDyuBh' "https://[YOUR_COMPANY].iquant.eu/floorplan/55?productId=123456&kioskId=KID5&"