To try these examples, you need to obtain an OAuth token first. Then you can submit
the example requests without having to build an application by either:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThis documentation provides examples of HTTP requests for interacting with the Google Fit REST API, covering data sources, datasets, and sessions.\u003c/p\u003e\n"],["\u003cp\u003eTo test these examples, obtain an OAuth token and use either the OAuth Playground or curl to submit requests.\u003c/p\u003e\n"],["\u003cp\u003eCurl usage requires installation, obtaining an OAuth token, and modifying provided commands with the token and request body file.\u003c/p\u003e\n"],["\u003cp\u003eDetailed instructions for authorization and getting started can be found in the linked resources.\u003c/p\u003e\n"]]],[],null,["# Running the Examples\n\nThe examples in the following pages show you how to construct HTTP requests to invoke the Fitness\nREST API:\n\n- [Managing Data Sources](/fit/rest/v1/data-sources)\n- [Working with Datasets](/fit/rest/v1/datasets)\n- [Working with Sessions](/fit/rest/v1/using-sessions)\n\nTo try these examples, you need to obtain an OAuth token first. Then you can submit\nthe example requests without having to build an application by either:\n\n- Using the [OAuth Playground](https://developers.google.com/oauthplayground/) from your browser.\n- Using [curl](http://curl.haxx.se/) from the command line.\n\nSubmit requests with the OAuth Playground\n-----------------------------------------\n\nThis process is described in [Getting Started](/fit/rest/v1/get-started). The examples\nindicate the HTTP method to use and provide the request body.\n\nSubmit requests with curl\n-------------------------\n\nPrerequisites:\n\n- Install [curl](http://curl.haxx.se) if it is not installed on your machine.\n- Obtain an OAuth token as described in [Getting Started](/fit/rest/v1/get-started).\n\nFore more information about OAuth tokens and authorization, see\n[Authorizing Requests](/fit/rest/v1/authorization).\n\nTo run each of the examples:\n\n1. Copy and paste the request body from the example into a plain text file.\n2. Copy the `curl` command from the example and paste it into a terminal window.\n3. Edit the command to replace the OAuth token value and the name of the file that contains the request body.\n4. Run the resulting command on the terminal.\n\n`curl` sends the HTTP request with the authorization header and shows the response on the terminal."]]