Mục tiêu
GET https://analytics.ipcidr.com/api/goals/
curl --request GET \
--url 'https://analytics.ipcidr.com/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://analytics.ipcidr.com/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
| Tham số | Chi tiết | Mô tả |
|---|---|---|
| website_id | Tùy chọn Số nguyên | |
| type | Tùy chọn Chuỗi | Giá trị cho phép: pageview, custom |
| search | Tùy chọn Chuỗi | Chuỗi tìm kiếm. |
| search_by | Tùy chọn Chuỗi | Tìm theo trường. Cho phép: name, path, key. |
| datetime_field | Tùy chọn Chuỗi | Giá trị cho phép: datetime, last_datetime |
| datetime_start | Tùy chọn Chuỗi | Lọc từ. Định dạng Y-m-d H:i:s. |
| datetime_end | Tùy chọn Chuỗi | Lọc đến. Định dạng Y-m-d H:i:s. |
| order_by | Tùy chọn Chuỗi | Sắp xếp theo trường. Cho phép: goal_id, last_datetime, datetime, name, path, key. |
| order_type | Tùy chọn Chuỗi | Thứ tự. ASC tăng dần, DESC giảm dần. |
| page | Tùy chọn Số nguyên | Số trang. Mặc định 1. |
| results_per_page | Tùy chọn Số nguyên | Kết quả mỗi trang. Cho phép: 10, 25, 50, 100, 250, 500, 1000. Mặc định 25. |
{
"data": [
{
"id": 1,
"website_id": 1,
"user_id": 1,
"key": "123456789",
"type": "custom",
"path": null,
"name": "Example",
"datetime": "2026-06-04 01:56:23",
"last_datetime": null
},
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://analytics.ipcidr.com/api/goals?page=1",
"last": "https://analytics.ipcidr.com/api/goals?page=1",
"next": null,
"prev": null,
"self": "https://analytics.ipcidr.com/api/goals?page=1"
}
}
GET https://analytics.ipcidr.com/api/goals/{goal_id}
curl --request GET \
--url 'https://analytics.ipcidr.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://analytics.ipcidr.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-06-04 01:56:23",
"last_datetime": null
}
}
POST https://analytics.ipcidr.com/api/goals
| Tham số | Chi tiết | Mô tả |
|---|---|---|
| website_id | Bắt buộc Số nguyên | - |
| type | Bắt buộc Chuỗi | Giá trị cho phép: pageview, custom |
| name | Bắt buộc Chuỗi | - |
| path | Tùy chọn Chuỗi | Khả dụng khi: type = pageview |
| key | Tùy chọn Chuỗi | - |
curl --request POST \
--url 'https://analytics.ipcidr.com/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'chart_datetime=2026-06-04 01:56:23' \
--url 'https://analytics.ipcidr.com/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'chart_datetime=2026-06-04 01:56:23' \
{
"data": {
"id": 1
}
}
POST https://analytics.ipcidr.com/api/goals/{goal_id}
| Tham số | Chi tiết | Mô tả |
|---|---|---|
| website_id | Tùy chọn Số nguyên | - |
| type | Tùy chọn Chuỗi | Giá trị cho phép: pageview, custom |
| name | Tùy chọn Chuỗi | - |
| path | Tùy chọn Chuỗi | Khả dụng khi: type = pageview |
| key | Tùy chọn Chuỗi | - |
curl --request POST \
--url 'https://analytics.ipcidr.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'is_enabled=0' \
--url 'https://analytics.ipcidr.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://analytics.ipcidr.com/api/goals/{goal_id}
curl --request DELETE \
--url 'https://analytics.ipcidr.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://analytics.ipcidr.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \