Skip to main content

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

ReturnDescription
Device Scan Successfully SentThe device scan was performed successfully, as well as the submission of the extracted information.

Error return

ErrorDescription
Web Token ErrorThe 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 RequestDevice information was not collected correctly.
Internal Server ErrorAn unexpected error occurred; check your internet connection.