REST API Introducción e inicio de sesión

Solicitud

Las solicitudes deben enviarse utilizando HTTPS. Todas las URL comienzan con la dirección asignada. En esta documentación, indicaremos: https://[YOUR_COMPANY].iquant.eu.

Póngase en contacto con el soporte de Quant para obtener su dirección URL. 

Formatos compatibles

Actualmente, la API soporta los formatos JSON y SVG en función del tipo de solicitud.

Si utiliza otro formato, recibirá una respuesta del servidor HTTP 415 Unsupported Media Type.

Tratamiento de errores

Si la API no está disponible temporalmente, la respuesta de error será 5XX. En este caso, es responsabilidad del cliente reintentar la solicitud.

Inicio de sesión

El inicio de sesión es necesario para comunicarse con la API. En respuesta al inicio de sesión, recibirá un token que utilizará para posteriores solicitudes. La ficha es válida durante 30 minutos. Si el token caduca, deberá volver a iniciar sesión para recibir uno nuevo.

Debe iniciar sesión utilizando el rol del usuario de Robot que se crea en Quant. 

 

  • REST Solicitud:
Parámetro
Valor
URL
/authenticate
Encabezado
Accept: application/json
Encabezado
Content-type: application/json
Método
POST
Payload
{"username":"<username>","password":"<password>"}
  • REST Respuesta:
Parámetro
Valor
Cuerpo
{"token":"<token>","status":"<result>"}

Si el inicio de sesión se realiza correctamente, recibirá una respuesta: HTTP 200. Si el inicio de sesión se realiza correctamente, recibirá una respuesta. De lo contrario, el atributo de estado de la respuesta contendrá un mensaje de error, por ejemplo:

HTTP 401 {"token":"","status":"Wrong username or password!"}"

Inicio de sesión en REST API

Solicitud

curl -H "accept: application/json" -H "content-type: application/json" "https://[YOUR_COMPANY].iquant.eu/authenticate" -d "{\"username\":\"xxxx\",\"password\":\"xxxx\"}"

Respuesta

{"token":"nAti4s84yqxmgcOf16IOmp4NwLaJV7kJIoGFnzTDrra0JSEG02","status":"SUCCESS"}

Autorización

La autorización se realiza mediante un token adjunto a la cabecera HTTP.

Parámetro
Valor
Encabezado
Authorization: Bearer <TOKEN>

Si el token ya no es válido, recibirá una respuesta:

 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&"

Automatic Tasks Setting

In Quant, you need to set up specific automatic tasks in order to automate the entire data transfer process.

  • Desktop Rights

First, however, you need to set up desktop rights to view and edit the automatic tasks.

Desktop Rights
  • Automatic Task Setting

In the Automatic Task section, click on the New button to add a specific automatic task, which you must then set up in the Settings tab.

Automatic Tasks
  • Default Task Settings

Some settings are repeated for all tasks, so it's a good idea to set all the repeating properties in the Default Task Settings tab as you need them so you don't have to change them for every tasks individually.

In the Default Task Settings, we recommend configuring attributes whose values are the same for all imports and exports, so you don’t have to set them individually each time. An example might be Emails for Notifications, where you specify the email addresses to which error status reports should be sent.

Default Task Settings