Posting Beats
Add heart rate 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": "Heart rates contain negative value." }
{ "message": "Timestamps ('start' or 'end') are not in UNIX seconds" }Code Sample:
curl --location --request POST "https://cardiogr.am/heart/oauth/users/1/beats" \
--header "Content-Type: application/json" \
--data "{ \"beats\": [{ \"start\": 1546025628, \"end\": 1546025628, \"value\": 60 }, { \"start\": 1546025701, \"end\": 1546025701, \"value\": 62 }] }"var settings = {
"url": "https://cardiogr.am/heart/oauth/users/1/beats",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": "{ \"beats\": [{ \"start\": 1546025628, \"end\": 1546025628, \"value\": 60 }, { \"start\": 1546025701, \"end\": 1546025701, \"value\": 62 }] }",
};
$.ajax(settings).done(function (response) {
console.log(response);
});import requests
url = 'https://cardiogr.am/heart/oauth/users/1/beats'
payload = "{ \"beats\": [{ \"start\": 1546025628, \"end\": 1546025628, \"value\": 60 }, { \"start\": 1546025701, \"end\": 1546025701, \"value\": 62 }] }"
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?