The QR API is wrapper API that supports multiple QR code related functionalities.
POST –
Sandbox: https://api-vtqa.halo.fitness/partnerapi/api2/qr
Production : https://api.halo.fitness/partnerapi/api2/qr
Headers:
- Uses Oauth2 bearer token and x-api-key
Sample:
- Authorization: Bearer 86fff145e28XXXXXXXX|6c5feXXXXXXXXXXXXXXX
- X-api-key: xxxxxxxxxxx (Oauth1 client key)
Body:
{
"qrCodeURL": "https://lfconnect.com/q?t=c&l=SMT-UAAAAA",
"workoutId": 123456,
"preferredUnit": "M",
"userHeight": 62,
"action": "logout"
}
Mandatory params: qrCodeURL
Note – Not all the optional parameters are relevant to all the use cases.
- ‘workoutId’ is optional and applicable only when doing Cardio Login.
- ‘preferredUnit’ and ‘userHeight’ are applicable when retrieving the strength videos to get the recommended seat position for the user.
- ‘action’ is mandatory and applicable only when doing Strength Logout
The API supports the following use cases:
1. Cardio Login:
A user can be logged in to any Life Fitness cardio equipment using this API.
Request:
{
"qrCodeURL": "https://lfconnect.com/q?t=c&l=SMT-UKMCCH",
"workoutId": 30367
}
QRcode formats possible for this use case:
- https://lfconnect.com/q?t=c&l={{bodySerial}}
- https://lfconnect.com/q?t=c&s={{qrcode}}
- https://lfconnect.com/q?t=c&l={{bodySerial}}&x=821&c=0&a=001C7BD763CA
Response:
Success:
Status code - 200
{
"status": "SUCCESSFUL",
"data": {
"type": "cardioLogin",
"qrCodeURL": "https://lfconnect.com/q?t=c&l=SMT-UAAAAA"
},
"error": "",
"meta": {}
}
Failure:
Status code - 400
{
"status": "FAILURE",
"data": {
"type": "cardioLogin",
"qrCodeURL": "https://lfconnect.com/q?t=c&l=SMT-UAAAAA"
},
"error": "API Error Code: 1002 API Error Message: Asset not found - bodySerial: SMT-UAAAAA",
"meta": {}
}
2. Save cardio workout to user’s profile:
When a user successfully completes a workout, the workout results can be saved to the user's profile by scanning and sending the QR code generated on the console to this API.
Request:
{
"qrCodeURL": "https://vtqa.halo.fitness/q?t=c&r=eyJpZCI6IjFmN2FiY2RhLWFjMGUtNGI2Zi04NzczLTIzYjcxMzY0MjQyYiIsImJzIjoiU01ULVVLTUROTyIsInQiOiI2OCIsImR0IjoiMjAxOS0xMi0xNlQxNTo1NDozNy0wNjowMCIsImV0IjoiNjMiLCJjIjoiMyIsImQiOnsidSI6IjAiLCJ2IjoiMC4xNzM5In0sImRjIjp7InUiOiIwIiwidiI6IjI3MzAuMDAwMCJ9LCJhcyI6eyJ1IjoiMCIsInYiOiI5LjkzNjUifSwiYXAiOnsidSI6IjAiLCJ2IjoiNjowMiJ9LCJhaSI6IjUuMDAwMCIsImFsIjoiMC4wMDAwIiwiYWhyIjoiMCIsImFtIjoiMCIsImF3IjoiMCIsImFyIjoiMC4wIiwiYXNwbSI6IjAuMCIsImFzbCI6IjAuMCJ9"
}
Response:
Success:
Status code - 200
{
"status": "SUCCESSFUL",
"data": {
"type": "cardioWorkoutData",
"qrCodeURL": "https://vtqa.halo.fitness/q?t=c&r=eyJpZCI6IjFmN2FiY2RhLWFjMGUtNGI2Zi04NzczLTIzYjcxMzY0MjQyYiIsImJzIjoiU01ULVVLTUROTyIsInQiOiI2OCIsImR0IjoiMjAxOS0xMi0xNlQxNTo1NDozNy0wNjowMCIsImV0IjoiNjMiLCJjIjoiMyIsImQiOnsidSI6IjAiLCJ2IjoiMC4xNzM5In0sImRjIjp7InUiOiIwIiwidiI6IjI3MzAuMDAwMCJ9LCJhcyI6eyJ1IjoiMCIsInYiOiI5LjkzNjUifSwiYXAiOnsidSI6IjAiLCJ2IjoiNjowMiJ9LCJhaSI6IjUuMDAwMCIsImFsIjoiMC4wMDAwIiwiYWhyIjoiMCIsImFtIjoiMCIsImF3IjoiMCIsImFyIjoiMC4wIiwiYXNwbSI6IjAuMCIsImFzbCI6IjAuMCJ9"
},
"error": "",
"meta": {}
}
Failure:
Status code – 400
{
"status": "FAILURE",
"data": {
"type": "cardioWorkoutData",
"qrCodeURL": "https://vtqa.halo.fitness/q?t=c&r=eyJpZCI6IjFmN2FiY2RhLWFjMGUtNGI2Zi04NzczLTIzYjcxMzY0MjQyYiIsImJzIjoiU01ULVVLTUROTyIsInQiOiI2OCIsImR0IjoiMjAxOS0xMi0xNlQxNTo1NDozNy0wNjowMCIsImV0IjoiNjMiLCJjIjoiMyIsImQiOnsidSI6IjAiLCJ2IjoiMC4xNzM5In0sImRjIjp7InUiOiIwIiwidiI6IjI3MzAuMDAwMCJ9LCJhcyI6eyJ1IjoiMCIsInYiOiI5LjkzNjUifSwiYXAiOnsidSI6IjAiLCJ2IjoiNjowMiJ9LCJhaSI6IjUuMDAwMCIsImFsIjoiMC4wMDAwIiwiYWhyIjoiMCIsImFtIjoiMCIsImF3IjoiMCIsImFyIjoiMC4wIiwiYXNwbSI6IjAuMCIsImFzbCI6IjAuMCJ9"
},
"error": "API Error Code: 1002 API Error Message: Workout cannot be saved",
"meta": {}
}
3. Retrieve Strength videos:
The API can be used to receive strength equipment workout videos when the QR code on the equipment is scanned by the user.
Request:
{
"qrCodeURL” : "https://lfconnect.com/q?t=s&m=sbsdip",
"preferredUnit": "M",
"userHeight": "68”
}
Response:
Success:
Status code - 200
{
"status": "SUCCESSFUL",
"data": {
"type": "strengthvideos",
"qrCodeURL": "https://lfconnect.com/q?t=s&m=sbsdi",
"officialTitle": "SYNRGY BlueSky Dip Leg Raise Station",
"video": [
"https://www.youtube.com/watch?v=shvDeU4JfPw",
"https://www.youtube.com/watch?v=H8icCZI0nVk"
],
"targetMuscles": "",
"workoutName": [
"Dip Leg Raise Dips",
"Dip Leg Raise Leg Raise"
]
},
"error": "",
"meta": {}
}
Failure:
Status code - 400
{
"status": "FAILURE",
"data": {
"type": "strengthvideos",
"qrCodeURL": "https://lfconnect.com/q?t=s&wrongMachineModelId=sbsdi"
},
"error": "API Error Code: 240 API Error Message: Invalid QR Code - url: https://lfconnect.com/q?t=s&wrongMachineModelId=sbsdip",
"meta": {}
}
4. Strength equipment login:
A user can be logged in to the strength equipment by using this API.
Request:
{
"qrCodeURL": "https://example.com/qr/<assetId>"
}
Response:
Success:
Status code - 200
{
"status": "SUCCESSFUL",
"data": {
"type": "strengthLogin",
"qrCodeURL": "https://example.com/qr/<assetId>"
},
"error": "",
"meta": {}
}
Failure:
Status code - 400
{
"status": "FAILURE",
"data": {
"type": "strengthLogin",
"qrCodeURL": "https://example.com/qr/<assetId>"
},
"error": "<error string>",
"meta": {}
}
5. Strength equipment logout
A user can be logged out from the strength equipment by using this API.
Request:
{
"qrCodeURL": https://example.com/qr/<assetId>,
"action": "logout"
}
Response:
Success:
Status code - 200
{
"status": "SUCCESSFUL",
"data": {
"type": "strengthLogout",
"qrCodeURL": "https://example.com/qr/<assetId>"
},
"error": "",
"meta": {}
}
Failure:
Status code - 400
{
"status": "FAILURE",
"data": {
"type": "strengthLogout",
"qrCodeURL": "https://example.com/qr/<assetId>"
},
"error": "<error string>",
"meta": {}
}
Error codes:
- Missing parameter/s.
- Workout cannot be saved
- Invalid QR Code.
- Unauthorized
- Unauthorized to access user data
- User not found.
- User disabled
- Asset not found.
- Asset offline.
- Workout not found.
- Matching workout does not belong to this user Workout activity not found.
- Workout not applicable for current equipment type
- User cannot login.
- Workout name missing
- Program timeout is not within allowable range
- Invalid QR Code
- Invalid Preferred Unit
- Cannot retrieve the Strength equipment video links.
- User height is not in the range for providing config information.
Comments
0 comments
Article is closed for comments.