Fitbit Plus API
Overview The Fitbit Plus API is a RESTful API. The requests and responses are formated according to the [JSON API](http://jsonapi.org/format/1.0/)…
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
Overview
The Fitbit Plus API is a RESTful API. The requests and responses are formated according to the
JSON API specification.
In addition to this documentation, we also provide an
OpenAPI "yaml" file describing the API:
[Fitbit Plus API Specification](swagger.yaml).
Authentication
Authentication for the Fitbit Plus API is based on the
OAuth 2.0 Authorization Framework. Fitbit Plus currently supports grant
types of client_credentials and refresh_token.
See POST /oauth/token for details on the request and response formats.
-->
Building Integrations
We will provide customers with unique client credentials for each application/integration they build, allowing us
to enforce appropriate access controls and monitor API usage.
The client credentials will be scoped to the organization, and allow full access to all patients and related data
within that organization.
These credentials are appropriate for creating an integration that does one of the following:
- background reporting/analysis
- synchronizing data with another system (such as an EMR)
The API credentials and oauth flows we currently support are not well suited for creating a user-facing
application that allows a user (patient, coach, or admin) to login and have access to data which is appropriate to
that specific user. It is possible to build such an application, but it is not possible to use Fitbit Plus as a
federated identity provider. You would need to have a separate means of verifying a user's identity. We do not
currently support the required password-based oauth flow to make this possible.
Paging
The Fitbit Plus API supports two different pagination strategies for GET collection endpoints.
Skip-based paging
Skip-based paging uses the query parameters page[size] and page[number] to specify the max number of resources returned and the page number. We default to skip-based paging if there are no page parameters. The response will include a links object containing links to the first, last, prev, and next pages of data.
If the contents of the collection change while you are iterating through the collection, you will see duplicate or missing documents. For example, if you are iterating through the calender_event resource via GET /pub/calendar_event?sort=start_at&page[size]=50&page[number]=1, and a new calendar_event is created that has a start_at value before the first calendar_event, when you fetch the next page at GET /pub/calendar_event?sort=start_at&page[size]=50&page[number]=2, the first entry in the second response will be a duplicate of the last entry in the first response.
Cursor-based paging
Cursor-based paging uses the query parameters page[limit] and page[after] to specify the max number of entries returned and identify where to begin the next page. Add page[limit] to the parameters to use cursor-based paging. The response will include a links object containing a link to the next page of data, if the next page exists.
Cursor-based paging is not subject to duplication if new resources are added to the collection. For example, if you are iterating through the calender_event resource via GET /pub/calendar_event?sort=start_at&page[limit]=50, and a new calendar_event is created that has a start_at value before the first calendar_event, you will not see a duplicate entry when you fetch the next page at GET /pub/calendar_event?sort=start_at&page[limit]=50&page[after]= .
We encourage the use of cursor-based paging for performance reasons.
In either form of paging, you can determine whether any resources were missed by comparing the number of fetched resources against meta.count. Set page[size] or page[limit] to 0 to get only the count.
It is not valid to mix the two strategies.
Endpoints 62
oauth
- POSTCreate an oauth token
/oauth/token?include=groupsCreate an OAuth 2.0 Bearer token. A valid bearer token is required for all other API requests. Be sure to set the header Content-Type:… - GETGet the groups for a token
/oauth/token/:id/groupsGet the list of groups a token can be used to access. - GETGet the organization for a token
/oauth/token/:id/organizationGet the organization a token can be used to access.
organization
- GETGet an organization
/organization/:idGet an organization record by id.
group
- GETList groups
/group?filter[organization]=string&filter[name]=stringGet a list of groups matching the specified filters. - POSTCreate a group
/groupCreate a group record. - GETGet a group
/group/:idGet a group record by id.
coach
- GETList coaches
/coach?filter[groups]=string&filter[organization]=stringGet a list of coaches matching the specified filters. - GETGet a coach
/coach/:idGet a coach record by id.
reward program
- GETList reward programs
/reward_program?filter[groups]=string&filter[organization]=stringGet a list of reward programs matching the specified filters. - POSTCreate a reward program
/reward_programCreate a reward program for a group. - GETGet a reward program
/reward_program/:idGet a reward program record by id. - GETGet group for a reward program
/reward_program/:id/groupGet the group related to a reward program.
action
- POSTCreate action
/actionCreate a plan action - GETGet an action
/action/:idGet a health action from a patient's plan. - PATCHUpdate an action
/action/:idUpdate a health action from a patient's plan.
bundle
- POSTCreate bundle
/bundleCreate a bundle in a patient's plan - GETGet a bundle
/bundle/:idGet a bundle from a patient's plan. - PATCHUpdate a bundle
/bundle/:idUpdte a bundle from a patient's plan.
calendar event
- GETList calendar events
/calendar_event?filter[patient]=string&filter[groups]=string&filter[organization]=string&filter[attendees]=string&filter[type]=plan-check-in&filter[completed]=true&filter[start_at]=string&filter[end_at]=string&filter[completed_at]=string&filter[created_at]=string&filter[updated_at]=string&page[number]=1&page[size]=10&page[limit]=50&page[cursor]=string&include=ownerGet a list of calendar events - POSTCreate calendar event
/calendar_eventCreate a calendar event for a patient. Attribute all_day must be set to true and end_at cannot be set for plan-check-in event type. - GETGet a calendar event
/calendar_event/:idGet a calendar event by id - DELETEDelete a calendar event
/calendar_event/:idDelete a calendar event by id - PATCHUpdate a calendar event
/calendar_event/:idUpdate a calendar event for a patient. Attribute all_day must be true and end_at cannot be specified for plan-check-in event type. To mark a calendar event as…
calendar event response
- POSTCreate calendar event response
/calendar_event_responseCreate a calendar event response for an attendee of a calendar event, the attendee can be a coach or patient. Calendar event responses cannot be fetched,…
email history
- GETList email histories
/email_history?filter[receiver]=string&filter[sender]=string&filter[emailType]=string&sort=send_timeGet a list of email histories - GETGet an email history
/email_history/:idGet an email history by id
health profile
- GETList health profiles
/health_profile?filter[patient]=string&filter[groups]=string&filter[organization]=string&page[number]=1&page[size]=10&page[limit]=50&page[cursor]=string&include=patientGet a list of health profiles - GETGet a health profile
/health_profile/:id?include=patientGet a health profile by id
health profile answer
- GETList health profile answers
/health_profile_answer?filter[patient]=string&filter[groups]=string&filter[organization]=string&page[number]=1&page[size]=50&page[limit]=50&page[cursor]=string&include=patientGet a list of health profile answers - GETGet a health profile answer
/health_profile_answer/:id?include=patientGet a health profile answer by id
health profile question
- GETList health profile questions
/health_profile_question?filter[patient]=string&filter[groups]=string&filter[organization]=string&include=question_definitionGet a list of health profile questions - GETGet a health profile question
/health_profile_question/:id?include=question_definitionGet a health profile by id
health question definition
- GETList health question definitions
/health_question_definitionGet a list of all health question definitions - GETGet a health question definition
/health_question_definition/:idGet a health question definition by id
metric
- GETList patient health metrics
/patient_health_metric?filter[patient]=string&filter[groups]=string&filter[organization]=string&page[number]=1&page[size]=10&page[limit]=50&page[cursor]=stringGet a list of patient health metrics. - POSTCreate patient health metrics
/patient_health_metricCreate one or more patient health metrics. Example for creating a patient health result with a patient specified using meta.query instead of id: { "data": {… - GETGet a patient health metric
/patient_health_metric/:idGet the plan summary for a patient.
patient
- GETList patients
/patient?filter[groups]=string&filter[organization]=string&filter[identifier][system]=string&filter[identifier][value]=string&filter[archived]=true&filter[created_at]=string&filter[updated_at]=string&page[number]=1&page[size]=10&page[limit]=50&page[cursor]=stringGet a list of patients. - PUTUpsert patient
/patientCreate a new patient or update an existing patient - POSTCreate a patient
/patientCreate a patient record. Example for creating a patient with a group specified using meta.query instead of id: { "data": { "type": "patient", "attributes": {… - GETGet a patient
/patient/:idGets a patient record by id. - PATCHUpdate a patient
/patient/:idUpdate a patient record. - GETList coaches for a patient
/patient/:id/coachesGet the list of coaches for a patient. - GETList groups for a patient
/patient/:id/groupsGet the list of groups for a patient.
plan
- GETList patient plan summaries
/patient_plan_summary?filter[patient]=string&filter[groups]=string&filter[organization]=string&include=actionsGet a list of patient plan summaries - GETGet the plan summary for a patient
/patient_plan_summary/:id?include=actionsGet the plan summary for a patient. - PATCHUpdate a plan summary
/patient_plan_summary/:idUpdate a plan summary record for a patient.
result
- GETList patient health results
/result?filter[patient]=string&filter[actions]=string&filter[start_at]=string&filter[end_at]=string&filter[threads]=string&filter[created_at]=string&filter[updated_at]=string&page[number]=1&page[size]=10&page[limit]=50&page[after]=stringGet a list of patient health results. - GETGet a patient health result
/result/:idGet patient health result by id.
reward
- GETList rewards
/reward?filter[patient]=string&filter[reward_program_activation]=string&filter[thread]=string&filter[groups]=string&filter[organization]=stringGet a list of rewards matching the specified filters. - POSTCreate a reward
/rewardCreate a reward for a patient. - GETGet a reward
/reward/:idGet a reward record by id.
reward earning
- GETList reward earnings
/reward_earning?filter[groups]=string&filter[patient]=string&filter[ready_for_fulfillment]=trueGet a list of reward earnings matching the specified filters. - POSTCreate a reward earning
/reward_earningCreate a reward earning for a reward. There can only be one earning for a reward. It is possilble to create multiple reward earnings simultaneously by… - GETGet a reward earning
/reward_earning/:idGet a reward earning record by id.
reward earning fulfillment
- GETList reward earning fulfillments
/reward_earning_fulfillment?filter[patient]=stringGet a list of reward earning fulfillments matching the specified filters. - POSTCreate a reward earning fulfillment
/reward_earning_fulfillmentCreate a reward earning fulfillment for a reward earning. There can only be one fulfillment for each earning. - GETGet a reward earning fulfillment
/reward_earning_fulfillment/:idGet a reward earning fulfillment record by id.
reward program activation
- GETList reward program activations
/reward_program_activation?filter[patient]=string&filter[groups]=string&filter[organization]=stringGet a list of reward program activations matching the specified filters. - POSTCreate a reward program activation
/reward_program_activationCreate a reward program activation for a patient. There can only be one activation for a patient for a given reward program. - GETGet a reward program activation
/reward_program_activation/:idGet a reward program activationrecord by id.
API details
- Base URL
https://api.twinehealth.com/pub- Authentication
- OAuth 2.0 (client credentials flow) with 2 scopes
- Operations
- 62 operations on 46 pathsGET 42POST 13PATCH 5PUT 1DELETE 1
- Main resources
- patient 7calendar event 5reward program 4action 3bundle 3group 3metric 3oauth 3plan 3reward 3
- Response formats
application/vnd.api+json- Description format
- OpenAPI 3.0.0, API version
v7.78.1 - Links
- OpenAPI document
- Listed from
- APIs.guru OpenAPI Directory (CC0-1.0)
Source updated
How to test the Fitbit Plus API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the Fitbit Plus API collection, without the publisher's secrets.
- Add your credentialsThis API uses OAuth 2.0 (client credentials flow) with 2 scopes. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Create an oauth token” (POST /oauth/token?include=groups), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the Fitbit Plus API?
Overview The Fitbit Plus API is a RESTful API. The requests and responses are formated according to the [JSON API](http://jsonapi.org/format/1.0/)… It is listed under Other and has 62 endpoints.
Who publishes the Fitbit Plus API?
It is listed from Twinehealth's public API description (an OpenAPI document), not published by Twinehealth on Swastik Codes. Anyone who controls twinehealth.com can claim the profile by adding a DNS TXT record.
What is the base URL of the Fitbit Plus API?
Requests go to https://api.twinehealth.com/pub. Endpoint paths are added to this base URL.
How do I authenticate with the Fitbit Plus API?
With OAuth 2.0 (client credentials flow) with 2 scopes.
How many endpoints does the Fitbit Plus API have?
62 operations on 46 paths (42 GET, 13 POST, 5 PATCH, 1 PUT, 1 DELETE). The largest groups are patient, calendar event, reward program, action.
Is forking the Fitbit Plus API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.