The QitechDeviceScan object
Important Note!
As of version 1.0.0, the authentication system has been updated to use a temporary token instead of mobileToken. The token is obtained by making a server-to-server request to the Device Scan API.
Request
To use the Device Scan plugin, you must call the startDeviceScan method, which has the following parameters:
Version 1.0.0+
| Parameter | Type | Purpose | Required |
|---|---|---|---|
| token | String | Temporary authentication token obtained by making a request to the Device Scan API. Must be generated using the same sessionId passed to this method. | Yes. |
| environment | CaaSEnvironment | Enum used to configure the runtime environment as sandbox or production. | Yes. |
| sessionId | String | Key that identifies the session from which the collected data originates. Must be sent in lowercase. | Yes. |
| eventType | String | An enum that defines the type of event being reported — care is requested so that very similar events are reported with the same enum, so that intelligence can be built on top of this data. | Yes. |
| eventId | String | An identifier of the event being reported. | Yes. |
| documentNumber | String? | The user's document number, if available. (CPF/CNPJ without dots, dashes, and slash). Can be omitted. | No. |
Previous Versions (up to 0.x)
| Parameter | Type | Purpose | Required |
|---|---|---|---|
| mobileToken | String | Customer key that identifies that the collected data comes from your application. If you have not yet received your mobile-token, contact support. | Yes. |
| environment | CaaSEnvironment | Enum used to configure the runtime environment as sandbox or production. | Yes. |
| sessionId | String | Key that identifies the session from which the collected data originates. Must be sent in lowercase. | Yes. |
| eventType | String | An enum that defines the type of event being reported — care is requested so that very similar events are reported with the same enum, so that intelligence can be built on top of this data. | Yes. |
| eventId | String | An identifier of the event being reported. | Yes. |
| documentNumber | String? | The user's document number, if available. (CPF/CNPJ without dots, dashes, and slash). Can be omitted. | No. |
Quick Reference (Migration)
- 1.0.0+: use temporary
tokenobtained via API (token: token) - < 1.0.0: use static
mobileToken(mobileToken: '<MOBILE_TOKEN_SENT_BY_QITECH>') - In both:
environment,sessionId,eventType, andeventIdare required.documentNumberis optional.
Return value
The method returns a String to indicate success or failure during information collection:
Success
Success collecting device scan data
Error
Device Scan fail. Check token, environment and permissions