Doelen
GET https://basicwebstats.com/api/goals/
curl --request GET \
--url 'https://basicwebstats.com/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://basicwebstats.com/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
| Parameters | Details | Beschrijving |
|---|---|---|
| website_id | Optioneel Geheel getal | |
| type | Optioneel String | Toegestane waarden: pageview, custom, scroll |
| search | Optioneel String | De zoekterm. |
| search_by | Optioneel String | Het veld waarin je zoekt. Toegestane waarden: name, path, key. |
| datetime_field | Optioneel String | Toegestane waarden: datetime, last_datetime |
| datetime_start | Optioneel String | Filter results starting from this datetime. Y-m-d H:i:s format. |
| datetime_end | Optioneel String | Filter results up to this datetime. Y-m-d H:i:s format. |
| order_by | Optioneel String | Het veld waarop je de resultaten sorteert. Toegestane waarden: goal_id, last_datetime, datetime, name, path, key, scroll_percentage. |
| order_type | Optioneel String | De sorteervolgorde. Gebruik ASC voor oplopend en DESC voor aflopend. |
| page | Optioneel Geheel getal | Het paginanummer waarvan je resultaten wilt. Standaardwaarde: 1. |
| results_per_page | Optioneel Geheel getal | Het aantal resultaten per pagina. Toegestane waarden: 10, 25, 50, 100, 250, 500, 1000. Standaardwaarde: 25. |
{
"data": [
{
"id": 1,
"website_id": 1,
"user_id": 1,
"key": "123456789",
"type": "custom",
"path": null,
"scroll_percentage": null,
"name": "Example",
"last_datetime": null,
"datetime": "2026-09-11 15:10:34"
}
],
"meta": {
"page": 1,
"total_pages": 1,
"results_per_page": 25,
"total_results": 1
},
"links": {
"first": "https://basicwebstats.com/api/goals?page=1",
"last": "https://basicwebstats.com/api/goals?page=1",
"next": null,
"prev": null,
"self": "https://basicwebstats.com/api/goals?page=1"
}
}
GET https://basicwebstats.com/api/goals/{goal_id}
curl --request GET \
--url 'https://basicwebstats.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://basicwebstats.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"website_id": 1,
"user_id": 1,
"key": "123456789",
"type": "custom",
"path": null,
"scroll_percentage": null,
"name": "Example",
"last_datetime": null,
"datetime": "2026-09-11 15:10:34"
}
}
POST https://basicwebstats.com/api/goals
| Parameters | Details | Beschrijving |
|---|---|---|
| website_id | Verplicht Geheel getal | - |
| type | Verplicht String | Toegestane waarden: pageview, custom, scroll |
| name | Verplicht String | - |
| path | Optioneel String | Beschikbaar als: type = pageview, scroll |
| scroll_percentage | Optioneel Geheel getal | Beschikbaar als: type = scroll |
| key | Optioneel String | - |
curl --request POST \
--url 'https://basicwebstats.com/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'website_id=1' \
--form 'name=Example' \
--form 'type=scroll' \
--form 'path=blog/*' \
--form 'scroll_percentage=75' \
--url 'https://basicwebstats.com/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'website_id=1' \
--form 'name=Example' \
--form 'type=scroll' \
--form 'path=blog/*' \
--form 'scroll_percentage=75' \
{
"data": {
"id": 1,
"website_id": 1,
"user_id": 1,
"key": "123456789",
"type": "scroll",
"path": "/blog/*",
"scroll_percentage": 75,
"name": "Example",
"last_datetime": null,
"datetime": "2026-09-11 15:10:34"
}
}
POST https://basicwebstats.com/api/goals/{goal_id}
| Parameters | Details | Beschrijving |
|---|---|---|
| website_id | Optioneel Geheel getal | - |
| type | Optioneel String | Toegestane waarden: pageview, custom, scroll |
| name | Optioneel String | - |
| path | Optioneel String | Beschikbaar als: type = pageview, scroll |
| scroll_percentage | Optioneel Geheel getal | Beschikbaar als: type = scroll |
| key | Optioneel String | - |
curl --request POST \
--url 'https://basicwebstats.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'type=scroll' \
--form 'path=blog/*' \
--form 'scroll_percentage=75' \
--url 'https://basicwebstats.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'type=scroll' \
--form 'path=blog/*' \
--form 'scroll_percentage=75' \
{
"data": {
"id": 1,
"website_id": 1,
"user_id": 1,
"key": "123456789",
"type": "scroll",
"path": "/blog/*",
"scroll_percentage": 75,
"name": "Example",
"last_datetime": "2026-09-11 15:10:34",
"datetime": "2026-09-11 15:10:34"
}
}
DELETE https://basicwebstats.com/api/goals/{goal_id}
curl --request DELETE \
--url 'https://basicwebstats.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://basicwebstats.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \