Fitbit Plus API
Overview
The Fitbit Plus API is a RESTful API. The requests and responses are formated according to the specification.
In addition to this documentation, we also provide an "yaml" file describing the API: Fitbit Plus API Specification [blocked].
Authentication
Authentication for the Fitbit Plus API is based on the . Fitbit Plus currently supports grant types of client_credentials and refresh_token.
See 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]=<cursor>.
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.
- Homepage
- https://api.apis.guru/v2/specs/twinehealth.com/v7.78.1.json
- Provider
- twinehealth.com
- OpenAPI version
- 2.0
- Spec (JSON)
- https://api.apis.guru/v2/specs/twinehealth.com/v7.78.1/openapi.json
- Spec (YAML)
- https://api.apis.guru/v2/specs/twinehealth.com/v7.78.1/openapi.yaml
Tools (64)
Extracted live via the executor SDK.
-
action.createActionCreate a plan action
-
action.fetchActionGet a health action from a patient's plan.
-
action.updateActionUpdate a health action from a patient's plan.
-
bundle.createBundleCreate a bundle in a patient's plan
-
bundle.fetchBundleGet a bundle from a patient's plan.
-
bundle.updateBundleUpdte a bundle from a patient's plan.
-
calendarEvent.createCalendarEventCreate a calendar event for a patient. Attribute
all_daymust be set totrueandend_atcannot be set forplan-check-inevent type. -
calendarEvent.deleteCalendarEventDelete a calendar event by id
-
calendarEvent.fetchCalendarEventGet a calendar event by id
-
calendarEvent.fetchCalendarEventsGet a list of calendar events
-
calendarEvent.updateCalendarEventUpdate a calendar event for a patient. Attribute
all_daymust be true andend_atcannot be specified forplan-check-inevent type. To mark a calendar event as 'completed', setcompleted_atandcompleted_byto desired values. To mark a completed calendar event as 'not completed', setcompleted_atandcompleted_bytonull. Attendees can be added or removed, but response status cannot be updated. Use the calendar event response api for response status updates instead. -
calendarEventResponse.createCalendarEventResponseCreate 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, updated nor deleted. Use calendar event api to fetch the response status for attendees.
-
coach.fetchCoachGet a coach record by id.
-
coach.fetchCoachesGet a list of coaches matching the specified filters.
-
emailHistory.fetchEmailHistoriesGet a list of email histories
-
emailHistory.fetchEmailHistoryGet an email history by id
-
group.createGroupCreate a group record.
-
group.fetchGroupGet a group record by id.
-
group.fetchGroupsGet a list of groups matching the specified filters.
-
healthProfile.fetchHealthProfileGet a health profile by id
-
healthProfile.fetchHealthProfilesGet a list of health profiles
-
healthProfileAnswer.fetchHealthProfileAnswerGet a health profile answer by id
-
healthProfileAnswer.fetchHealthProfileAnswersGet a list of health profile answers
-
healthProfileQuestion.fetchHealthProfileQuestionGet a health profile by id
-
healthProfileQuestion.fetchHealthProfileQuestionsGet a list of health profile questions
-
healthQuestionDefinition.fetchHealthQuestionDefinitionGet a health question definition by id
-
healthQuestionDefinition.fetchHealthQuestionDefinitionsGet a list of all health question definitions
-
metric.createPatientHealthMetricCreate one or more patient health metrics.
Example for creating a patient health result with a patient specified using
meta.queryinstead ofid:{ "data": { "type": "patient_health_metric", "attributes": { "code": { "system": "LOINC", "value": "13457-7" }, "type": "ldl_cholesterol", "occurred_at": "2017-03-14T11:00:57.000Z", "value": 121, "unit": "mg/dl" }, "relationships": { "patient": { "data": { "type": "patient", "meta": { "query": { "identifier": { "system": "medical-record-number", "value": "121212" }, "organization": "58c4554710123c5c40dbab81" } } } } } } } -
metric.fetchPatientHealthMetricGet the plan summary for a patient.
-
metric.fetchPatientHealthMetricsGet a list of patient health metrics.
-
oauth.createTokenCreate 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: "application/vnd.api+json". Otherwise, you will get an error 403 Forbidden. UsingContent-Type: "application/json"is permitted (to support older oauth clients) but when usingapplication/jsonthe body should have a body in the following format instead of nesting underdata.attributes: -
oauth.fetchTokenGroupsGet the list of groups a token can be used to access.
-
oauth.fetchTokenOrganizationGet the organization a token can be used to access.
-
organization.fetchOrganizationGet an organization record by id.
-
patient.createPatientCreate a patient record.
Example for creating a patient with a group specified using
meta.queryinstead ofid:{ "data": { "type": "patient", "attributes": { "first_name": "Andrew", "last_name": "Smith" }, "relationships": { "groups": { "data": [ { "type": "group", "meta": { "query": { "organization": "58c88de7c93eb96357a87033", "name": "Patients Lead" } } } ] } } }} -
patient.fetchPatientGets a patient record by id.
-
patient.fetchPatientCoachesGet the list of coaches for a patient.
-
patient.fetchPatientGroupsGet the list of groups for a patient.
-
patient.fetchPatientsGet a list of patients.
-
patient.updatePatientUpdate a patient record.
-
patient.upsertPatientCreate a new patient or update an existing patient
-
plan.fetchPatientPlanSummariesGet a list of patient plan summaries
-
plan.fetchPatientPlanSummaryGet the plan summary for a patient.
-
plan.updatePatientPlanSummaryUpdate a plan summary record for a patient.
-
result.fetchPatientHealthResultGet patient health result by id.
-
result.fetchPatientHealthResultsGet a list of patient health results.
-
reward.createRewardCreate a reward for a patient.
-
reward.fetchRewardGet a reward record by id.
-
reward.fetchRewardsGet a list of rewards matching the specified filters.
-
rewardEarning.createRewardEarningCreate 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 providing and array of reward earnings in the data property.
-
rewardEarning.fetchRewardEarningGet a reward earning record by id.
-
rewardEarning.fetchRewardEarningsGet a list of reward earnings matching the specified filters.
-
rewardEarningFulfillment.createRewardEarningFulfillmentCreate a reward earning fulfillment for a reward earning. There can only be one fulfillment for each earning.
-
rewardEarningFulfillment.fetchRewardEarningFulfillmentGet a reward earning fulfillment record by id.
-
rewardEarningFulfillment.fetchRewardEarningFulfillmentsGet a list of reward earning fulfillments matching the specified filters.
-
rewardProgram.createRewardProgramCreate a reward program for a group.
-
rewardProgram.fetchRewardProgramGet a reward program record by id.
-
rewardProgram.fetchRewardProgramGroupGet the group related to a reward program.
-
rewardProgram.fetchRewardProgramsGet a list of reward programs matching the specified filters.
-
rewardProgramActivation.createRewardProgramActivationCreate a reward program activation for a patient. There can only be one activation for a patient for a given reward program.
-
rewardProgramActivation.fetchRewardProgramActivationGet a reward program activationrecord by id.
-
rewardProgramActivation.fetchRewardProgramActivationsGet a list of reward program activations matching the specified filters.
-
openapi.previewSpecPreview an OpenAPI document before adding it as a source
-
openapi.addSourceAdd an OpenAPI source and register its operations as tools