website logo
⌘K
Quickstart
User
Metrics
Webhooks
Mobile SDK
V2
React Native
Flutter
Android (Kotlin)
Swift
V1
Errors
FAQ
Docs powered by
Archbee
Metrics
API Version 2 (V2)

Goals

You can retrieve user goals by user_id


Get a goals data by user_id
GET
Params
Query Parameters
user_id
required
String
User ID returned by add integration request. This key should be stored in your database against the user and used for all interactions with the Spike API.
Header Parameters
authorizationtoken
optional
String
Client access token (deprecated)
x-spike-auth
required
String
Client access token
Python
Node.js
Ruby
Java
Curl
|
curl -X GET \
  'https://api.spikeapi.com/v2/metrics/goals/?user_id=282812818&start_date=2020-05-01&end_date=2020-05-03' \
  -H 'x-spike-auth: fa0b3803-1111-2222-9788-eccce210d30c'
RESPONSES
200
|
{
    "user_id": "19291291291",
    "type": "goals",
    "source": [
        {
            "name": "fitbit",
            "status": "ok"
        }
    ],
    "data": [
		{
	        "daily":{
                "active_minutes": 30,
                "calories": 1950,
                "distance": 8.05,
                "floors": 10,
                "steps": 7500,
                "sleep": 480
			},
			"weekly": {
                "active_minutes": 130,
                "calories": 11950,
                "distance": 18.05,
                "floors": 110,
                "steps": 17500
			},
			"monthly": {
                "active_minutes": 230,
                "calories": 21950,
                "distance": 28.05,
                "floors": 210,
                "steps": 27500
			},
			"source": "fitbit"
		}
    ]
} 

<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap');

.h2, .h3, .list, .description{
	font-family: 'Poppins', sans-serif;
	font-weight: 500;
}

.h2 {
    margin-top: -20px;
    margin-bottom: 20px;

    font-size: 30px;
}

.h3 {
    font-size: 22px;
	margin-top: -20px;
}

.list-wrapper {
    white-space: normal;
     margin-top: -10px;
}

.list, .description {
    font-size: 14px;
}

</style>
<h2 class="h2">Fields</h2>
<h3 class="h3">Goals.daily.active_minutes</h3>
<ul class="list-wrapper">
    <li class="list">Type: Int</li>
    <li class="list">Example: 60</li>
</ul>
<p class="description">The active minutes goal.</p>

<h3 class="h3">Goals.daily.calories</h3>
<ul class="list-wrapper">
    <li class="list">Type: Int</li>
    <li class="list">Example: 2000</li>
</ul>
<p class="description">The calories goal.</p>

<h3 class="h3">Goals.daily.distance</h3>
<ul class="list-wrapper">
    <li class="list">Type: Float</li>
    <li class="list">Example: 5.2</li>
</ul>
<p class="description">The distance goal.</p>

<h3 class="h3">Goals.daily.floors</h3>
<ul class="list-wrapper">
    <li class="list">Type: Int</li>
    <li class="list">Example: 11</li>
</ul>
<p class="description">The floors goal.</p>

<h3 class="h3">Goals.daily.steps</h3>
<ul class="list-wrapper">
    <li class="list">Type: Int</li>
    <li class="list">Example:11000</li>
</ul>
<p class="description">The steps goal.</p>

<h3 class="h3">Goals.daily.sleep</h3>
<ul class="list-wrapper">
    <li class="list">Type: Int</li>
    <li class="list">Example:480</li>
</ul>
<p class="description">The sleep goal.</p>




Did this page help you?
PREVIOUS
Info
NEXT
Stress
Docs powered by
Archbee
Get Goals Data
TABLE OF CONTENTS
GET
Get Goals Data
Docs powered by
Archbee