curl --request GET \
--url https://api.onvy.health/habits \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onvy.health/habits"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onvy.health/habits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onvy.health/habits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onvy.health/habits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onvy.health/habits")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onvy.health/habits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_time": "2023-11-07T05:31:56Z",
"last_edited_time": "2023-11-07T05:31:56Z",
"archived": true,
"in_trash": true,
"url": "<string>",
"playUnexpectedImpact": true,
"category": "<string>",
"playImpact": true,
"title": "<string>",
"description": "<string>",
"cover": "<string>",
"public_url": "<string>",
"potentialImpacts": {}
}
]{
"error": "<string>"
}{
"error": "<string>"
}Get list of habits
Get a list of habits (Notion sourced)
curl --request GET \
--url https://api.onvy.health/habits \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onvy.health/habits"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onvy.health/habits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onvy.health/habits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onvy.health/habits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onvy.health/habits")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onvy.health/habits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_time": "2023-11-07T05:31:56Z",
"last_edited_time": "2023-11-07T05:31:56Z",
"archived": true,
"in_trash": true,
"url": "<string>",
"playUnexpectedImpact": true,
"category": "<string>",
"playImpact": true,
"title": "<string>",
"description": "<string>",
"cover": "<string>",
"public_url": "<string>",
"potentialImpacts": {}
}
]{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
OAuth bearer token for Health API authentication
Response
Successful response
The name identifier of the mindfulness activity
Unique identifier for the activity
ISO 8601 timestamp when the activity was created
ISO 8601 timestamp when the activity was last modified
Whether the activity is archived
Whether the activity is in trash
The primary URL for accessing the activity
Whether to play unexpected impact animations or effects
The category classification of the activity
Whether to play impact animations or effects
Human-readable title of the activity
Detailed description of the activity
URL to the cover image for the activity
Public URL if the activity is publicly accessible
Object containing various impact categories and their details
Show child attributes
Show child attributes
Was this page helpful?