Scans

Scan objects are created each time a dynamic QR Code is scanned. They capture information on the user scanning the QR code which is displayed on your dashboard.

Scans can be identified using their unique scanId which is generated for each new scan. The Scan data is updated in real-time, making it useful to gather customer data.

Attributes

Get Scans By Account Id

Retrieves Scans associated to an Openscreen Account.

The number of Scans retrieved can be modified using the 'limit' field for up to 100 per request. The next batch of Scans can be retrieved using the 'lastKey' field - a hashed key that points to the last object of the current batch.

Returns

Returns a list of Scan objects linked to an Openscreen account.

1 const accountScans = await os.account(accountId).scans().get();
{ "accountId": "xxxxxxxxxxxxxxxxxxxx", "lastKey": "xxxxxxxxxxx", "numberOfScans": 1, "scans": [ "scan": { "scanTime": "2021-10-14T15:35:41.115Z", "locationLongitude": "-114.07640", "engineName": "Blink", "locationString": "Calgary, Alberta, Canada", "locationRegionName": "Alberta", "locationCountryName": "Canada", "locationTimeZone": "America/Edmonton", "modified": "2021-10-14T15:35:42.474Z", "deviceModel": "SM-G973W", "deviceType": "mobile", "browserVersion": "15.0", "scanId": "c262c53e-3ec0-4f48-823e-de5539dd85dc", "deviceVendor": "Samsung", "osName": "Android", "locationCityName": "Calgary", "qrCodeId": "b5ca08a8-3ce5-4c33-8fca-605550f078aa", "engineVersion": "90.0.4430.210", "locationPostalCode": "T2R", "entity": "app.scan", "ipAddress": "xx.xxx.xxx.xxx", "locationRegionCode": "AB", "created": "2021-10-14T15:35:42.474Z", "osVersion": "11", "userAgent": "Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G973W) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/15.0 Chrome/90.0.4430.210 Mobile Safari/537.36", "locationLatitude": "51.04060", "projectId": "a76adcf6-002d-40e0-b156-7f2e2d82733b", "browserName": "Samsung Browser", "locationCountryCode": "CA", "assetId": "ef43b29d-55c5-48d4-b70c-80c1c145fe14" } ] }

Get Scans By Asset Id

Retrieves Scans recorded against an Asset.

The number of Scans retrieved can be modified using the 'limit' field for up to 100 per request. The next batch of Scans can be retrieved using the 'lastKey' field - a hashed key that points to the last object of the current batch.

Returns

Returns the list of all Scan objects for the given assetId. Throws an error if the assetId is invalid.

1 const scans = await os.asset(assetId).scans().get();
{ "entityType": "get_scans_by_asset_id.response_body", "asset": { "entityType": "app.asset", "modified": "2021-10-14T14:15:47.362Z", "projectId": "a76adcf6-002d-40e0-b156-7f2e2d82733b", "description": "Sign for 123 Main Street, Toronto", "customAttributes": { "type": "Sale", "MLS": "123ABC" }, "assetId": "ef43b29d-55c5-48d4-b70c-80c1c145fe14", "created": "2021-10-14T14:15:47.362Z", "name": "123Main Sign" }, "contacts": [ { "type": "OWNER", "emailAddress": "bsmith@test.com", "modified": "2021-10-14T14:14:33.042Z", "mailingAddress": { "country": "Canada", "postalOrZip": "A1B2C3", "address": "123 Street", "provinceOrState": "ON", "city": "Toronto" }, "cellPhone": "+14162121212", "consent": [ { "consentedAt": "2021-06-20 08:03:00.0", "url": "https://sidewalkqr.com/123main/consent", "consented": "accepted" } ], "firstName": "Brian", "contactId": "9a1363f4-8cd9-44fd-a2d2-edb4ac038b93", "lastName": "Smith", "created": "2021-10-14T14:14:33.042Z" } ], "scan": { "scanTime": "2021-10-14T15:35:41.115Z", "locationLongitude": "-114.07640", "engineName": "Blink", "locationString": "Calgary, Alberta, Canada", "locationRegionName": "Alberta", "locationCountryName": "Canada", "locationTimeZone": "America/Edmonton", "modified": "2021-10-14T15:35:42.474Z", "deviceModel": "SM-G973W", "deviceType": "mobile", "browserVersion": "15.0", "scanId": "c262c53e-3ec0-4f48-823e-de5539dd85dc", "deviceVendor": "Samsung", "osName": "Android", "locationCityName": "Calgary", "qrCodeId": "b5ca08a8-3ce5-4c33-8fca-605550f078aa", "engineVersion": "90.0.4430.210", "locationPostalCode": "T2R", "entity": "app.scan", "ipAddress": "xx.xxx.xxx.xxx", "locationRegionCode": "AB", "created": "2021-10-14T15:35:42.474Z", "osVersion": "11", "userAgent": "Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G973W) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/15.0 Chrome/90.0.4430.210 Mobile Safari/537.36", "locationLatitude": "51.04060", "projectId": "a76adcf6-002d-40e0-b156-7f2e2d82733b", "browserName": "Samsung Browser", "locationCountryCode": "CA", "assetId": "ef43b29d-55c5-48d4-b70c-80c1c145fe14" }, "qrCode": { "intent": "https://sidewalkqr.com/123main", "locatorKeyType": "SHORT_URL", "scanCount": 4, "modified": "2021-10-14T16:03:29.984Z", "locatorKey": "caPFy3Tifrc", "qrCodeId": "b5ca08a8-3ce5-4c33-8fca-605550f078aa", "intentType": "DYNAMIC_REDIRECT", "assetId": "ef43b29d-55c5-48d4-b70c-80c1c145fe14", "entity": "app.qr-code", "created": "2021-10-14T14:15:47.389Z" } }

Get Scans By Project Id

Retrieves Scans associated to a Project.

The number of Scans retrieved can be modified using the 'limit' field for up to 100 scans per request. The next batch of Scans can be retrieved using the 'lastKey' field - a hashed key that points to the last object of the current batch.

Returns

Returns a list of Scan objects containing unique scanIds. The scanId can be used for creating post-scan workflows.

1 const scans = await os.project(projectId).scans().get();
{ "entityType": "get_scans_by_project_id.response_body", "projectId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "lastKey": "xxxxxxxx", "numberOfScans": 2, "scans": [ { "entityType": "app.scan", "created": "2021-10-14T16:03:30.052Z", "modified": "2021-10-14T16:03:30.052Z", "assetId": "ef43b29d-55c5-48d4-b70c-80c1c145fe14", "scanId": "3eef9e7e-95bf-4097-acef-42843fa00a0d", "projectId": "a76adcf6-002d-40e0-b156-7f2e2d82733b", "qrCodeId": "b5ca08a8-3ce5-4c33-8fca-605550f078aa", "ipAddress": "xx.xxx.xxx.xx", "scanTime": "2021-10-14T16:03:29.139Z", "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Mobile/15E148 Safari/604.1", "deviceType": "mobile", "deviceModel": "iPhone", "deviceVendor": "Apple", "osName": "iOS", "osVersion": "15.0.2", "engineName": "WebKit", "engineVersion": "605.1.15", "browserName": "Mobile Safari", "browserVersion": "15.0", "locationPostalCode": "21270", "locationLatitude": "32.58310", "locationLongitude": "-115.30050", "locationCityName": "Mexicali", "locationRegionName": "Baja California", "locationRegionCode": "BCN", "locationCountryName": "Mexico", "locationCountryCode": "MX", "locationTimeZone": "America/Tijuana", "locationString": "Mexicali, Baja California, Mexico" }, { "entityType": "app.scan", "created": "2021-10-14T15:47:32.511Z", "modified": "2021-10-14T15:47:32.511Z", "assetId": "ef43b29d-55c5-48d4-b70c-80c1c145fe14", "scanId": "89e8e1f0-f03e-4d66-bc19-f8b398709d83", "projectId": "a76adcf6-002d-40e0-b156-7f2e2d82733b", "qrCodeId": "b5ca08a8-3ce5-4c33-8fca-605550f078aa", "ipAddress": "xx.xxx.xxx.xx", "scanTime": "2021-10-14T15:47:32.241Z", "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1", "deviceType": "mobile", "deviceModel": "iPhone", "deviceVendor": "Apple", "osName": "iOS", "osVersion": "14.7.1", "engineName": "WebKit", "engineVersion": "605.1.15", "browserName": "Mobile Safari", "browserVersion": "14.1.2", "locationPostalCode": "M6K", "locationLatitude": "43.64000", "locationLongitude": "-79.43300", "locationCityName": "Toronto", "locationRegionName": "Ontario", "locationRegionCode": "ON", "locationCountryName": "Canada", "locationCountryCode": "CA", "locationTimeZone": "America/Toronto", "locationString": "Toronto, Ontario, Canada" } ] }