Skip to main content

Pages

This guide explains how to interact with the admin manage the pages crud.

Get All Pages

Endpoint

  • Method: GET
  • URL: /v1/admin/pages

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Query Parameters

ParameterTypeDescriptionRequiredDefault
search_textstringPage's title, key...Nonull

Success Response

{
"success": true,
"message": "تم جلب بيانات المدرب بنجاح",
"data": {
"pages": [
{
"id": "uuid",
"title": "الشروط والاحكام",
"key": "customer-terms-and-conditions-with-privacy-policy",
"link": "https://testing-customer.calwe.com/pages/customer-terms-and-conditions-with-privacy-policy",
"canModified": true
},
]
},
"statusCode": 200
}

Error Response

Unauthorized (401)

{
"success": false,
"message": "يجب عليك تسجيل الدخول",
"data": [],
"statusCode": 401
}

Show Page

Endpoint

  • Method: GET
  • URL: /v1/admin/pages/{id}

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Success Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "uuid",
"title": "الشروط والاحكام",
"description": "<p>أولاً الوقوف على الحقيقة من معنين: أحدهما يقوم منه مقام الطين للكرة في هذا النوع من النظر. ثم كان يرجع إلى أنواع للعميل</p><h2>شروط واحكام خاصه بالعميل</h2>",
"type": null,
"key": "customer-terms-and-conditions-with-privacy-policy",
"link": "https://testing-customer.calwe.com/pages/customer-terms-and-conditions-with-privacy-policy",
"priority": 100,
"canModified": true,
"loggedInOnly": true,
"isActive": true
},
"statusCode": 200
}

Error Response

Unauthorized (401)

{
"success": false,
"message": "يجب عليك تسجيل الدخول",
"data": [],
"statusCode": 401
}

Recored Not Found (404)

{
"success": false,
"message": "لم يتم العثور على السجل",
"data": [],
"statusCode": 404
}

Create Page

Endpoint

  • Method: POST
  • URL: /v1/admin/pages

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Request Body

ParameterTypeDescriptionRequired
titlestringPage's titleYes
typestringPage's typeYes
descriptionstringPage's descriptionYes
keystringPage's keyYes
can_modifiedboolPage's can modifiedYes
logged_in_onlyboolFor logged in user's onlyYes
is_activeboolPage's activeYes
priorityintegerPage's priorityNo
metaarrayPage's metaNo

Success Response

{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": {
"id": "uuid",
"title": "الشروط والاحكام",
"description": "<p>أولاً الوقوف على الحقيقة من معنين: أحدهما يقوم منه مقام الطين للكرة في هذا النوع من النظر. ثم كان يرجع إلى أنواع للعميل</p><h2>شروط واحكام خاصه بالعميل</h2>",
"type": null,
"key": "customer-terms-and-conditions-with-privacy-policy",
"link": "https://testing-customer.calwe.com/pages/customer-terms-and-conditions-with-privacy-policy",
"priority": 100,
"canModified": true,
"loggedInOnly": true,
"isActive": true
},
"statusCode": 200
}

Error Response

Unauthorized (401)

{
"success": false,
"message": "يجب عليك تسجيل الدخول",
"data": [],
"statusCode": 401
}

Update Page

Endpoint

  • Method: PATCH
  • URL: /v1/admin/pages/{id}

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Request Body

ParameterTypeDescriptionRequired
titlestringPage's titleNo
typestringPage's typeNo
descriptionstringPage's descriptionNo
keystringPage's keyNo
can_modifiedboolPage's can modifiedNo
logged_in_onlyboolFor logged in user's onlyNo
is_activeboolPage's activeNo
priorityintegerPage's priorityNo
metaarrayPage's metaNo

Success Response

{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "uuid",
"title": "الشروط والاحكام",
"description": "<p>أولاً الوقوف على الحقيقة من معنين: أحدهما يقوم منه مقام الطين للكرة في هذا النوع من النظر. ثم كان يرجع إلى أنواع للعميل</p><h2>شروط واحكام خاصه بالعميل</h2>",
"type": null,
"key": "customer-terms-and-conditions-with-privacy-policy",
"link": "https://testing-customer.calwe.com/pages/customer-terms-and-conditions-with-privacy-policy",
"priority": 100,
"canModified": true,
"loggedInOnly": true,
"isActive": true
},
"statusCode": 200
}

Error Response

Unauthorized (401)

{
"success": false,
"message": "يجب عليك تسجيل الدخول",
"data": [],
"statusCode": 401
}

Recored Not Found (404)

{
"success": false,
"message": "لم يتم العثور على السجل",
"data": [],
"statusCode": 404
}

Delete Page

Endpoint

  • Method: DELETE
  • URL: /v1/admin/pages

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Request Body

ParameterTypeDescriptionRequired
idsarrayUser's idNo

Success Response

{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": [],
"statusCode": 200
}

Error Response

Recored Not Found (404)

{
"success": false,
"message": "لم يتم العثور على السجل",
"data": [],
"statusCode": 404
}

Validation (422)

{
"success": false,
"message": "لا يمكنك الحذف! يرجاء التاكد من الحقل can_modified",
"errors": [
"لا يمكنك الحذف! يرجاء التاكد من الحقل can_modified"
],
"data": [],
"statusCode": 422
}