Sleep 8 hours nightly
- userId
-
Alex Lang @alex_lang85
- name
- Sleep 8 hours nightly
- category
- sleep
- targetValue
- 8.5
- currentValue
- 4.7
- unit
- hours/night
- deadline
- 2026-05-20
- isCompleted
- false
- createdAt
Overview
goals / #157
Sleep 8 hours nightly
#157
Request
curl example
curl -sS \ "https://example-data.com/api/v1/goals/157" \ -H "Accept: application/json"
JavaScript example
const res = await fetch( "https://example-data.com/api/v1/goals/157" ); const goal = await res.json();
TypeScript example
// Download once: mkdir -p types && curl -o types/goals.d.ts https://example-data.com/types/goals.d.ts
import type { Goal } from "./types/goals";
const res = await fetch(
"https://example-data.com/api/v1/goals/157"
);
const goal = (await res.json()) as Goal; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/goals/157"
)
goal = res.json() Response
{
"id": 157,
"userId": 163,
"name": "Sleep 8 hours nightly",
"category": "sleep",
"targetValue": 8.5,
"currentValue": 4.7,
"unit": "hours/night",
"deadline": "2026-05-20",
"isCompleted": false,
"createdAt": "2026-03-17T14:04:18.781Z"
}