المهام
قيم حالة المهمة: scheduled، running، completed، failed، cancelled.
عرض جميع المهام
Section titled عرض جميع المهاماسترجاع جميع مهام مشروع ما، بما في ذلك المهام المكتملة والملغاة. مقسّم إلى صفحات.
الطريقة
Section titled الطريقةGET
/public/:projectKey/jobs
معلمات الاستعلام
Section titled معلمات الاستعلام| Name | Type | Description |
|---|---|---|
| limit | integer | حجم الصفحة، 1-200 (القيمة الافتراضية: 50). القيم خارج النطاق تعود إلى 50. |
| page | integer | رقم الصفحة، يبدأ من 1 (القيمة الافتراضية: 1). القيم < 1 تعود إلى 1. |
رؤوس الطلب
Section titled رؤوس الطلبAuthorization: Bearer {YOUR_ORGANIZATION_API_KEY}
مثال على الطلب
Section titled مثال على الطلبcurl -X GET \
'{BASE_URL}/public/3sWXSsqHgSKnE87YkNJK/jobs?limit=50&page=1' \
-H 'Authorization: Bearer {YOUR_ORGANIZATION_API_KEY}'
مثال على الاستجابة
Section titled مثال على الاستجابة{
"data": [
{
"jobId": 3451,
"description": "Delete user sessions of userId = shekar@example.com",
"status": "scheduled",
"projectId": 1,
"action": "delete_user_data",
"referenceId": "shekar@example.com",
"createdAt": 1623912955277,
"updatedAt": null,
"startAt": 1623954600000,
"errors": null
},
{
"jobId": 3452,
"description": "Delete user sessions of userId = mehdi@example.com",
"status": "cancelled",
"projectId": 1,
"action": "delete_user_data",
"referenceId": "mehdi@example.com",
"createdAt": 1623912962910,
"updatedAt": 1623913015276,
"startAt": 1623954600000,
"errors": null
}
]
}
الحصول على تفاصيل المهمة
Section titled الحصول على تفاصيل المهمةإرجاع حالة المهمة وبياناتها الوصفية.
الطريقة
Section titled الطريقةGET
/public/:projectKey/jobs/:jobId
المعلمات
Section titled المعلمات| Name | Type | Description |
|---|---|---|
| jobId | integer | معرّف المهمة (مطلوب) |
رؤوس الطلب
Section titled رؤوس الطلبAuthorization: Bearer {YOUR_ORGANIZATION_API_KEY}
رموز الحالة
Section titled رموز الحالة200: تم إرسال الاستجابة بصيغة JSON في النص
400: jobId غير صالح (ليس عدداً صحيحاً)
404: لم يتم العثور على المهمة
مثال على الطلب
Section titled مثال على الطلبcurl -X GET \
{BASE_URL}/public/3sWXSsqHgSKnE87YkNJK/jobs/3451 \
-H 'Authorization: Bearer {YOUR_ORGANIZATION_API_KEY}'
مثال على الاستجابة
Section titled مثال على الاستجابة{
"data": {
"jobId": 3451,
"description": "Delete user sessions of userId = shekar@example.com",
"status": "scheduled",
"projectId": 1,
"action": "delete_user_data",
"referenceId": "shekar@example.com",
"createdAt": 1623912955277,
"updatedAt": null,
"startAt": 1623954600000,
"errors": null
}
}
إلغاء المهمة
Section titled إلغاء المهمةإلغاء مهمة لم تبدأ بعد أو لا تزال قيد التنفيذ.
الطريقة
Section titled الطريقةDELETE
/public/:projectKey/jobs/:jobId
المعلمات
Section titled المعلمات| Name | Type | Description |
|---|---|---|
| jobId | integer | معرّف المهمة (مطلوب) |
رؤوس الطلب
Section titled رؤوس الطلبAuthorization: Bearer {YOUR_ORGANIZATION_API_KEY}
رموز الحالة
Section titled رموز الحالة200: تم إلغاء المهمة
400: لا يمكن إلغاء المهمة في حالتها الحالية، أو jobId غير صالح
404: لم يتم العثور على المهمة
مثال على الطلب
Section titled مثال على الطلبcurl -X DELETE \
{BASE_URL}/public/3sWXSsqHgSKnE87YkNJK/jobs/3452 \
-H 'Authorization: Bearer {YOUR_ORGANIZATION_API_KEY}'
مثال على الاستجابة
Section titled مثال على الاستجابة{
"data": {
"jobId": 3452,
"description": "Delete user sessions of userId = mehdi@example.com",
"status": "cancelled",
"projectId": 1,
"action": "delete_user_data",
"referenceId": "mehdi@example.com",
"createdAt": 1623912962910,
"updatedAt": 1623913015276,
"startAt": 1623954600000,
"errors": null
}
}