-
Notifications
You must be signed in to change notification settings - Fork 3
GET user fitbit auth
Retrieves user data from Fitbit account.
Permissions:
-
Application User can retrieve Fitbit authorization data from any Child.
-
Child user can only retrieve their own Fitbit authorization data.
-
Educator and HealthProfessional users can retrieve Fitbit authorization data from any Child as long as Child is part of one of their groups.
-
Family user can retrieve Fitbit authorization data only from child that associated with it.
external:sync
user_id: string (A 24-byte hex ID)
curl -X GET "https://localhost/v1/users/5c86d00c2239a48ea20a0134/fitbit/auth" -H "accept: application/json" -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
-
200
Fitbit auth data.{ "access_token": "eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0MzAzNDM3MzUsInNjb3BlcyI6Indwcm8gd2xvYyB3bnV0IHdzbGUgd3NldCB3aHIgd3dlaSB3YWN0IHdzb2MiLCJzdWIiOiJBQkNERUYiLCJhdWQiOiJJSktMTU4iLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJpYXQiOjE0MzAzNDAxMzV9.z0VHrIEzjsBnjiNMBey6wtu26yHTnSWz_qlqoEpUlpc", "refresh_token": "c643a63c072f0f05478e9d18b991db80ef6061e4f8e6c822d83fed53e5fafdd7", "status": "valid_token" }
Possible values of the status field description valid_token
Valid Access Token: The token is valid. expired_token
Expired Access Token: The access token has expired. invalid_token
Invalid Access Token: The access token is invalid. invalid_grant
Invalid Refresh Token: The refresh token is invalid. system
Too Many Requests: The limit of requests has been reached. client_error
Generic Error: A not-mapped Fitbit Client error occurs. -
400
Validation errors -
403
Permission Error -
404
Specified resource does not exist. Usually when the URI is incorrect or the resource is not found, or even no longer exists.{ "code": 404, "message": "Unable to find Fitbit authentication data!", "description": "You must enter new data before you can refer to it." }
OCARIoT API Gateway (Full documentation)
- POST institutions
- GET institutions
- GET institutions.inst_id
- PATCH institutions.inst_id
- DELETE institutions.inst_id
- POST children.physicalactivities
- GET children.physicalactivities
- GET children.physicalactivities.activity_id
- DELETE children.physicalactivities.activity_id
- POST children.weights
- GET children.weights
- GET children.weights.weight_id
- DELETE children.weights.weight_id
- POST children.bodyfats
- GET children.bodyfats
- GET children.bodyfats.bodyfat_id
- DELETE children.bodyfats.bodyfat_id
- POST educators.children.groups
- GET educators.children.groups
- GET educators.children.groups.group_id
- PATCH educators.children.groups.group_id
- DELETE educators.children.groups.group_id
- POST healthprofessionals
- GET healthprofessionals
- GET healthprofessionals.hprof_id
- PATCH healthprofessionals.hprof_id
- POST healthprofessionals.children.groups
- GET healthprofessionals.children.groups
- GET healthprofessionals.children.groups.group_id
- PATCH healthprofessionals.children.groups.group_id
- DELETE healthprofessionals.children.groups.group_id
- POST institutions.environments
- GET institutions.environments
- DELETE institutions.environments
- DELETE institutions.environments.environment_id
- Invalid ID
- Invalid JSON format
- Missing fields
- Empty string
- Invalid string
- Invalid date
- Negative number
- Invalid number
- Unregistered institution
- Unregistered children
- Invalid children attribute type
- Invalid children items
- Empty ID(s) in children attribute
- ID(s) with invalid format in children
- Attempting to update password on wrong route
- Child does not exist
- Institution does not exist