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:
- URL
- Body
https://{domain}/api/scan
{
"uid": "decffb55-ed16-4f7a-9e51-8d24813d37bd",
"tail": "off" | "on",
"deviceOsType": "ios" | "android" | "windows" | "macos" | "web"
"data": {
"longitude": 38.889371,
"latitude": 77.035260,
"isAppClip": true,
"tagTokenId": "15ae2506-d5da-417e-a31f-63a857f29ab9",
"deviceId": "2734e5e0-1d04-4fe3-accb-c8a2ffd9569a"
}
}
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
- HTTP 200
- HTTP 400
{
"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
}
}
{
"error": "Token is not exist." | "tokenId and UID do not match." | "This tag is deactivated." | "Server timeout." | "The device does not support"
}
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.