Skip to main content

Scan

Introduction

This page explains the creation and update of scan data. The scan API requires using the NFC scanning feature on the mobile phone to scan the tag before being utilized. For testing, please insert "https://sandbox-staging-app.berify.io" into the {domain} section of the URL.

Create a scan data

POST /scan

Creates a new scan data.

Request header:

  • secretKey: string. Use "App-Berify-Secret".
  • secret: string

Optional header:

  • Berify-App-User-Id: string

Request body:

  • uid: string
  • tail: string
  • deviceOsType: string
  • data:
    • latitude: number
    • longitude: number
    • isAppClip: boolean
    • tagTokenId: string
    • deviceId: string | null

Example:

https://{domain}/api/scan

Response:

  • scan:
    • id: number
    • tagTokenId: string
    • userId: string | null
    • isAppClip: boolean
    • longitude: number | null
    • latitude: number | null
    • location: string | null
    • isHidden: boolean
    • createdAt: Date
    • isDelete: boolean
    • isVisitedPromo: boolean
    • isVisitedShop: boolean
    • isVisitedExplore: boolean
    • isDeviceFirstScan: boolean | null
  • error: string
{
"scan": {
"id": 876,
"tagTokenId": "ec89db6e-88c9-4092-a511-b1a9252d5002",
"userId": "97e236af-5701-4e40-893c-5083a501681d",
"isAppClip": true,
"longitude": 38.889371,
"latitude": 77.035260,
"location": "2 15th St NW, Washington, DC 20024, United States",
"isHidden": true,
"createdAt": "2024-01-31 04:18:48",
"isDelete": false,
"isVisitedPromo": true,
"isVisitedShop" : true,
"isVisitedExplore" : true,
"isDeviceFirstScan" : true
}
}

HTTP status code summary:

  • 200 (OK) - Everything worked as expected.
  • 401 (Unauthorized) - Invalid or missing access token.
  • 405 (Method Not Allowed) - Unacceptable HTTP method for requested resource.