Skip to content

GET user fitbit auth

Jefferson Medeiros edited this page Dec 2, 2019 · 4 revisions

Description

Retrieves user data from Fitbit account.

URL

POST https://localhost:5001/v1/users/{user_id}/fitbit/auth

Parameters

user_id: string (A 24-byte hex ID)

Curl example

curl -X GET "https://localhost:5001/v1/users/5c86d00c2239a48ea20a0134/fitbit/auth" -H "accept: application/json"

Response body

  • 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

  • 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."
    }
  • 500 Internal Server Error