Documentation · API reference
POST
/api/v1/sites/{site}/goals/testPost goal test
This page as Markdown, or in an AI chatMore ways to read this page
# Post goal test
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/post-sites-site-goals-test
`POST /api/v1/sites/{site}/goals/test`
## Parameters
- `site` (in path, needed): The site's id or name
## What to send
`object`
## The answer
200, `GoalTest`: What a goal would have counted, before it is saved (EV-09).
- `by_day` (list of number or null, needed): By the day, for a small chart. `null` is a day nothing was counted.
- `days` (integer, needed)
- `note` (string, needed): What cannot be tested this way, in a sentence. Empty when all of it was.
- `period` (PeriodView, needed)
- `times` (number, needed): Times it would have been reached.
## Asking
```sh
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/goals/test \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
```
Parameters
- sitein the address
- neededThe site's id or name
What to send
object
The answer
Status 200
GoalTest What a goal would have counted, before it is saved (EV-09).
- by_day
- list of number or nullneededBy the day, for a small chart. `null` is a day nothing was counted.
- days
- integerneeded
- note
- stringneededWhat cannot be tested this way, in a sentence. Empty when all of it was.
- period
- PeriodViewneeded
- times
- numberneededTimes it would have been reached.
Asking
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/goals/test \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \ -H "Content-Type: application/json" \ -d '{}'
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/goals/test", { method: "POST", headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({}), }).then((r) => r.json());