Collecting the returns
The Web Device Scan SDK returns a Promise, which will return a String indicating the completion of the flow in success cases. In error cases, it will return a String describing the error. Below is an example of how to map each of these cases and retrieve the results:
<script>
var deviceScan = new vPkg.DeviceScan('web_token', 'session_id')
deviceScan.setSandbox()
deviceScan.setGeoLocation(true)
deviceScan.info('event_type', 'event_id')
.then((res) => console.log(res))
.catch((error) => console.log(error))
</script>
Success return
| Return | Description |
|---|---|
| Device Scan Successfully Sent | The device scan was performed successfully, as well as the submission of the extracted information. |
Error return
| Error | Description |
|---|---|
| Web Token Error | The web token used is invalid. If you are sure you are using the Web Token provided by QI Tech correctly, contact our support (suporte.caas@qitech.com.br) immediately. |
| Invalid Request | Device information was not collected correctly. |
| Internal Server Error | An unexpected error occurred; check your internet connection. |