Tags
Introduction
This page explains the APIs for retrieving and updating the information, and transferring the ownership of a tag. For testing, please insert "https://sandbox-staging-app.berify.io" into the {
domain}
section of the URL.
Get specific tag
GET /tags/{
tokenId}
Retrieves the information of a single tag.
Request header:
- secretKey: string. Use "App-Berify-Secret".
- secret: string
Request parameters:
- tokenId: string. The tokenId is the tagTokenId obtained when scanning the tag. #Scan
Example:
- URL
https://{domain}/api/tags/{tokenId}
Response:
- batchId: string
- tokenId: string
- batchSerialNumber: number
- batch:
- experience:
- isGlobal: boolean
- experience:
{
"batchId": "8a8dd60e-d5cf-4378-a1c7-b74110bc8373",
"tokenId": "c738ef3b-a882-40ef-a7e8-0474178f6631",
"batchSerialNumber": 1,
"batch": {
"experience": {
"isGlobal": 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.
Get specific tags
GET /tags/{
tokenId}
?batchId={
batchId}
&batchSerialNumberGte={
batchSerialNumberGte}
&batchSerialNumberLte={
batchSerialNumberLte}
Retrieves the tokenId of multiple tags.
Request header:
- secretKey: string. Use "App-Berify-Secret".
- secret: string
Request parameters:
- tokenId: string.The tokenId is the tagTokenId obtained when scanning the tag. #Scan
- batchId: string
- batchSerialNumberGte: number (Range to GET)
- batchSerialNumberLte: number (Range to GET)
Example:
- URL
https://{domain}/api/tags/{tokenId}?batchId={batchId}&batchSerialNumberGte=1&batchSerialNumberLte=2
Response:
- tokenId: string
- batchSerialNumber: number
{
{
"tokenId": "a17d2839-67b4-4e35-99ba-0d434eccd526",
"batchSerialNumber": 1
},
{
"tokenId": "41de7fe5-4459-45ae-9c8f-649d3fe9d1a4",
"batchSerialNumber": 2
}
}
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.
Update tag info visible
UPDATE /tags/{
tokenId}
/infoVisible
Updates the status of the infoVisible field of the tag.
Request header:
- secretKey: string. Use "App-Berify-Secret".
- secret: string
Request parameters:
- tokenId: string. The tokenId is the tagTokenId obtained when scanning the tag. #Scan
Request body:
- ownerId: string. The ownerId is the userId of oneself. It needs to be obtained through third party login to retrieve one's own userId.
- isInfoVisible: boolean
Example:
- URL
- Body
https://{domain}/api/tags/{tokenId}/infoVisible
{
"ownerId": "7bd67187-94b7-4ee7-bb75-5802e6199053",
"isInfoVisible": true
}
Response:
- error: string | undefined
- HTTP 200
- HTTP 400
{}
{
"error": "this is not your account." | "this is not your tag." | "update error."
}
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.
Update tag owner
POST /tags/{
tokenId}
Updates the tag owner of a single tag.
Request header:
- secretKey: string. Use "App-Berify-Secret".
- secret: string
Request parameters:
- tokenId: string. The tokenId is the tagTokenId obtained when scanning the tag. #Scan
Request body:
- ownerId: string. The ownerId is the userId of oneself. It needs to be obtained through third party login to retrieve one's own userId.
Example:
- URL
- Body
https://{domain}/api/tags/{tokenId}
{
"ownerId": "c738ef3b-aqw2-40ef-a7e8-04741dwf6631"
}
Response:
- tagTokenId: string
- error: string | undefined
- HTTP 200
- HTTP 400
{
"tagTokenId": "a17d2839-67b4-4e35-99ba-0d434eccd526"
}
{
"error": "this is not your account." | "create error." | "this is not your tag." | "undo expired." | "delete error."
}
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.
Undo transfer tag owner
DELETE /tags/{
tokenId}
/transfer
Deletes the ownership of the tag.
Request header :
- secretKey : string. Use "App-Berify-Secret".
- secret : string
Request parameters :
- tokenId : string. The tokenId is the tagTokenId obtained when scanning the tag. #Scan
Request body :
- ownerId : string. The ownerId is the userId of oneself. It needs to be obtained through third party login to retrieve one's own userId.
Example :
- URL
- Body
https://{domain}/api/tags/{tokenId}/transfer
{
"ownerId": "f89aa13e-0fa3-4609-ade7-802a1f652fcb"
}
Response :
- tagTokenId : string
- error : string | undefined
- HTTP 200
- HTTP 400
{
"tagTokenId": "a17d2839-67b4-4e35-99ba-0d434eccd526"
}
{
"error": "this is not your account." | "create error." | "this is not your tag." | "undo expired." | "delete error."
}
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.