Goals
GET https://analyticse.com/api/goals/
curl --request GET \
--url 'https://analyticse.com/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://analyticse.com/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
| 参数 | 细节 | 描述 |
|---|---|---|
| website_id | 可选的 整数 | |
| type | 可选的 字符串 | 允许的值:pageview, custom, scroll |
| search | 可选的 字符串 | 搜索字符串。 |
| search_by | 可选的 字符串 | 您正在按哪个字段搜索。允许的值为:name, path, key。 |
| datetime_field | 可选的 字符串 | 允许的值:datetime, last_datetime |
| datetime_start | 可选的 字符串 | 开始日期 |
| datetime_end | 可选的 字符串 | 结束日期 |
| order_by | 可选的 字符串 | 按哪个字段排序结果。允许的值有:goal_id, last_datetime, datetime, name, path, key, scroll_percentage。 |
| order_type | 可选的 字符串 | 结果的排序。允许的值为:ASC 表示升序排序,DESC 表示降序排序。 |
| page | 可选的 整数 | 您想要结果的页码。默认为 1。 |
| results_per_page | 可选的 整数 | 每页您想要多少个结果。允许的值是:10, 25, 50, 100, 250, 500, 1000。默认为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-12 00:49:07"
}
],
"meta": {
"page": 1,
"total_pages": 1,
"results_per_page": 25,
"total_results": 1
},
"links": {
"first": "https://analyticse.com/api/goals?page=1",
"last": "https://analyticse.com/api/goals?page=1",
"next": null,
"prev": null,
"self": "https://analyticse.com/api/goals?page=1"
}
}
GET https://analyticse.com/api/goals/{goal_id}
curl --request GET \
--url 'https://analyticse.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://analyticse.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-12 00:49:07"
}
}
POST https://analyticse.com/api/goals
| 参数 | 细节 | 描述 |
|---|---|---|
| website_id | 必需 整数 | - |
| type | 必需 字符串 | 允许的值:pageview, custom, scroll |
| name | 必需 字符串 | - |
| path | 可选的 字符串 | 可用时间:type = pageview, scroll |
| scroll_percentage | 可选的 整数 | 可用时间:type = scroll |
| key | 可选的 字符串 | - |
curl --request POST \
--url 'https://analyticse.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://analyticse.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-12 00:49:07"
}
}
POST https://analyticse.com/api/goals/{goal_id}
| 参数 | 细节 | 描述 |
|---|---|---|
| website_id | 可选的 整数 | - |
| type | 可选的 字符串 | 允许的值:pageview, custom, scroll |
| name | 可选的 字符串 | - |
| path | 可选的 字符串 | 可用时间:type = pageview, scroll |
| scroll_percentage | 可选的 整数 | 可用时间:type = scroll |
| key | 可选的 字符串 | - |
curl --request POST \
--url 'https://analyticse.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://analyticse.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-12 00:49:07",
"datetime": "2026-09-12 00:49:07"
}
}
DELETE https://analyticse.com/api/goals/{goal_id}
curl --request DELETE \
--url 'https://analyticse.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://analyticse.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \