Obiettivi

GET https://heymetrica.com/api/goals/
curl --request GET \
--url 'https://heymetrica.com/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
Parametri Dettagli Descrizione
website_id Opzionale Intero
type Opzionale Stringa Valori consentiti: pageview, custom
search Opzionale Stringa La stringa di ricerca.
search_by Opzionale Stringa Per quale campo stai cercando. Valori consentiti: name, path, key.
datetime_field Opzionale Stringa Valori consentiti: datetime, last_datetime
datetime_start Opzionale Stringa Filter results starting from this datetime. Y-m-d H:i:s format.
datetime_end Opzionale Stringa Filter results up to this datetime. Y-m-d H:i:s format.
order_by Opzionale Stringa Per quale campo ordinare i risultati. Valori consentiti: goal_id, last_datetime, datetime, name, path, key.
order_type Opzionale Stringa L'ordinamento dei risultati. Valori consentiti: ASC per ordine crescente, e DESC per ordine decrescente.
page Opzionale Intero Il numero di pagina da cui vuoi i risultati. Predefinito 1.
results_per_page Opzionale Intero Quanti risultati vuoi per pagina. Valori consentiti: 10, 25, 50, 100, 250, 500, 1000. Predefinito 25.
{
    "data": [
        {
            "id": 1,
            "website_id": 1,
            "user_id": 1,
            "key": "123456789",
            "type": "custom",
            "path": null,
            "name": "Example",
            "datetime": "2026-11-08 04:46:39",
            "last_datetime": null
        },
    ],
    "meta": {
        "page": 1,
        "results_per_page": 25,
        "total": 1,
        "total_pages": 1
    },
    "links": {
        "first": "https://heymetrica.com/api/goals?page=1",
        "last": "https://heymetrica.com/api/goals?page=1",
        "next": null,
        "prev": null,
        "self": "https://heymetrica.com/api/goals?page=1"
    }
}
GET https://heymetrica.com/api/goals/{goal_id}
curl --request GET \
--url 'https://heymetrica.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,
        "name": "Example",
        "datetime": "2026-11-08 04:46:39",
        "last_datetime": null
    }
}
POST https://heymetrica.com/api/goals
Parametri Dettagli Descrizione
website_id Obbligatorio Intero -
type Obbligatorio Stringa Valori consentiti: pageview, custom
name Obbligatorio Stringa -
path Opzionale Stringa Disponibile quando: type = pageview
key Opzionale Stringa -
curl --request POST \
--url 'https://heymetrica.com/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'chart_datetime=2026-11-08 04:46:39' \
{
    "data": {
        "id": 1
    }
}
POST https://heymetrica.com/api/goals/{goal_id}
Parametri Dettagli Descrizione
website_id Opzionale Intero -
type Opzionale Stringa Valori consentiti: pageview, custom
name Opzionale Stringa -
path Opzionale Stringa Disponibile quando: type = pageview
key Opzionale Stringa -
curl --request POST \
--url 'https://heymetrica.com/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://heymetrica.com/api/goals/{goal_id}
curl --request DELETE \
--url 'https://heymetrica.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \