Posting Steps
Add step count data to user
Path Parameters
Name
Type
Description
Headers
Name
Type
Description
Request Body
Name
Type
Description
{ "success": true }// One of the following messages:
{ "message": "Malformed input." }
{ "message": "Step values contain negative value." }
{ "message": "Timestamps ('start' or 'end') are not in UNIX seconds" }
{ "message": "End time greater than start time for a step data point." }Code Sample:
curl --location --request POST "https://cardiogr.am/heart/oauth/users/1/steps" \
--header "Content-Type: application/json" \
--data "{ \"steps\": [{ \"start\": 1546025622, \"end\": 1546025820, \"value\": 105 }] }"var settings = {
"url": "https://cardiogr.am/heart/oauth/users/1/steps",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": "{ \"steps\": [{ \"start\": 1546025622, \"end\": 1546025820, \"value\": 105 }] }",
};
$.ajax(settings).done(function (response) {
console.log(response);
});import requests
url = 'https://cardiogr.am/heart/oauth/users/1/steps'
payload = "{ \"steps\": [{ \"start\": 1546025622, \"end\": 1546025820, \"value\": 105 }] }"
headers = {
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers = headers, data = payload, allow_redirects=False, timeout=undefined, allow_redirects=false)
print(response.text)Last updated
Was this helpful?