Objectifs
GET https://digitalstats.net/api/goals/
curl --request GET \
--url 'https://digitalstats.net/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://digitalstats.net/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
| Paramètres | Détails | Description |
|---|---|---|
| website_id | Facultatif Entier | |
| type | Facultatif Chaîne | Valeurs autorisées : pageview , custom |
| search | Facultatif Chaîne | La chaîne de recherche. |
| search_by | Facultatif Chaîne | Par quel champ recherchez-vous. Les valeurs autorisées sont : name, path, key. |
| order_by | Facultatif Chaîne | Par quel champ trier les résultats. Les valeurs autorisées sont : goal_id, last_datetime, datetime, name, path, key. |
| order_type | Facultatif Chaîne | L'ordre des résultats. Les valeurs autorisées sont : ASC pour l'ordre croissant et DESC pour l'ordre décroissant. |
| page | Facultatif Entier | Le numéro de la page dont vous souhaitez obtenir les résultats. La valeur par défaut est 1. |
| results_per_page | Facultatif Entier | Combien de résultats souhaitez-vous par page. Les valeurs autorisées sont : 10 , 25 , 50 , 100 , 250 , 500 , 1000. La valeur par défaut est 25. |
{
"data": [
{
"id": 1,
"website_id": 1,
"user_id": 1,
"key": "123456789",
"type": "custom",
"path": null,
"name": "Example",
"datetime": "2026-04-29 12:38:29",
"last_datetime": null
},
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://digitalstats.net/api/goals?page=1",
"last": "https://digitalstats.net/api/goals?page=1",
"next": null,
"prev": null,
"self": "https://digitalstats.net/api/goals?page=1"
}
}
GET https://digitalstats.net/api/goals/{goal_id}
curl --request GET \
--url 'https://digitalstats.net/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://digitalstats.net/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"website_id": 1,
"user_id": 1,
"key": "123456789",
"type": "custom",
"path": null,
"name": "Example",
"datetime": "2026-04-29 12:38:29",
"last_datetime": null
}
}
POST https://digitalstats.net/api/goals
| Paramètres | Détails | Description |
|---|---|---|
| website_id | Requis Entier | - |
| type | Requis Chaîne | Valeurs autorisées : pageview , custom |
| name | Requis Chaîne | - |
| path | Facultatif Chaîne | Disponible lorsque : type = pageview |
| key | Facultatif Chaîne | - |
curl --request POST \
--url 'https://digitalstats.net/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'chart_datetime=2026-04-29 12:38:29' \
--url 'https://digitalstats.net/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'chart_datetime=2026-04-29 12:38:29' \
{
"data": {
"id": 1
}
}
POST https://digitalstats.net/api/goals/{goal_id}
| Paramètres | Détails | Description |
|---|---|---|
| website_id | Facultatif Entier | - |
| type | Facultatif Chaîne | Valeurs autorisées : pageview , custom |
| name | Facultatif Chaîne | - |
| path | Facultatif Chaîne | Disponible lorsque : type = pageview |
| key | Facultatif Chaîne | - |
curl --request POST \
--url 'https://digitalstats.net/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'is_enabled=0' \
--url 'https://digitalstats.net/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'is_enabled=0' \
{
"data": {
"id": 1
}
}
DELETE https://digitalstats.net/api/goals/{goal_id}
curl --request DELETE \
--url 'https://digitalstats.net/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://digitalstats.net/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \