目標
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}' \
| 參數 | 詳細資料 | 描述 |
|---|---|---|
| website_id | 選填 整數 | |
| type | 選填 字串 | 允許的值:pageview, custom |
| search | 選填 字串 | 搜尋字串。 |
| search_by | 選填 字串 | 您要搜尋的欄位。允許的值為:name, path, key。 |
| datetime_field | 選填 字串 | 允許的值:datetime, last_datetime |
| datetime_start | 選填 字串 | 從此日期時間開始篩選結果。格式為 Y-m-d H:i:s。 |
| datetime_end | 選填 字串 | 篩選結果至此日期時間。格式為 Y-m-d H:i:s。 |
| order_by | 選填 字串 | 排序結果的欄位。允許的值為:goal_id, last_datetime, datetime, name, path, key。 |
| 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,
"name": "Example",
"datetime": "2026-06-04 02:06:24",
"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 02:06:24",
"last_datetime": null
}
}
POST https://analytics.ipcidr.com/api/goals
| 參數 | 詳細資料 | 描述 |
|---|---|---|
| website_id | 必填 整數 | - |
| type | 必填 字串 | 允許的值:pageview, custom |
| name | 必填 字串 | - |
| path | 選填 字串 | 可用條件:type = pageview |
| key | 選填 字串 | - |
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 02:06:24' \
--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 02:06:24' \
{
"data": {
"id": 1
}
}
POST https://analytics.ipcidr.com/api/goals/{goal_id}
| 參數 | 詳細資料 | 描述 |
|---|---|---|
| website_id | 選填 整數 | - |
| type | 選填 字串 | 允許的值:pageview, custom |
| name | 選填 字串 | - |
| path | 選填 字串 | 可用條件:type = pageview |
| key | 選填 字串 | - |
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}' \