اهداف
GET https://data.cheraghestan.com/api/goals/
curl --request GET \
--url 'https://data.cheraghestan.com/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://data.cheraghestan.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-10-13 15:22:49",
"last_datetime": null
},
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://data.cheraghestan.com/api/goals?page=1",
"last": "https://data.cheraghestan.com/api/goals?page=1",
"next": null,
"prev": null,
"self": "https://data.cheraghestan.com/api/goals?page=1"
}
}
GET https://data.cheraghestan.com/api/goals/{goal_id}
curl --request GET \
--url 'https://data.cheraghestan.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://data.cheraghestan.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-10-13 15:22:49",
"last_datetime": null
}
}
POST https://data.cheraghestan.com/api/goals
| پارامترها | جزئیات | توضیحات |
|---|---|---|
| website_id | الزامی عدد صحیح | - |
| type | الزامی رشته | مقادیر مجاز: pageview, custom |
| name | الزامی رشته | - |
| path | اختیاری رشته | در دسترس زمانی که: type = pageview |
| key | اختیاری رشته | - |
curl --request POST \
--url 'https://data.cheraghestan.com/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'chart_datetime=2026-10-13 15:22:49' \
--url 'https://data.cheraghestan.com/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'chart_datetime=2026-10-13 15:22:49' \
{
"data": {
"id": 1
}
}
POST https://data.cheraghestan.com/api/goals/{goal_id}
| پارامترها | جزئیات | توضیحات |
|---|---|---|
| website_id | اختیاری عدد صحیح | - |
| type | اختیاری رشته | مقادیر مجاز: pageview, custom |
| name | اختیاری رشته | - |
| path | اختیاری رشته | در دسترس زمانی که: type = pageview |
| key | اختیاری رشته | - |
curl --request POST \
--url 'https://data.cheraghestan.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://data.cheraghestan.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://data.cheraghestan.com/api/goals/{goal_id}
curl --request DELETE \
--url 'https://data.cheraghestan.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://data.cheraghestan.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \