ContactUs Reasons
This guide explains how to interact with the admin manage the contactUs reasons crud.
Get All ContactUs Reasons
Endpoint
- Method: GET
- URL:
/v1/admin/contact-us-reasons
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Query Parameters
| Parameter | Type | Description | Required | Default |
|---|---|---|---|---|
| search_text | string | ContactUs Reason's degree | No | null |
Success Response
{
"success": true,
"message": "تم جلب بيانات المدرب بنجاح",
"data": {
"contactUsReasons": [
{
"id": "uuid",
"reason": "عميل",
"problemCount": 2,
"type": "COACH",
"priority": 1,
"isActive": false
},
]
},
"statusCode": 200
}
Error Response
Unauthorized (401)
{
"success": false,
"message": "يجب عليك تسجيل الدخول",
"data": [],
"statusCode": 401
}
Show ContactUs Reason
Endpoint
- Method: GET
- URL:
/v1/admin/contact-us-reasons/{id}
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "uuid",
"reason": "عميل",
"priority": 1,
"type": "COACH",
"isActive": false,
"problems": [
{
"id": "uuid",
"subReason": "frrfr",
"priority": 2,
"isActive": true,
"reasonId": "uuid"
}
]
},
"statusCode": 200
}
Error Response
Unauthorized (401)
{
"success": false,
"message": "يجب عليك تسجيل الدخول",
"data": [],
"statusCode": 401
}
Recored Not Found (404)
{
"success": false,
"message": "لم يتم العثور على السجل",
"data": [],
"statusCode": 404
}
Create ContactUs Reason
Endpoint
- Method: POST
- URL:
/v1/admin/contact-us-reasons
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Request Body
| Parameter | Type | Description | Required |
|---|---|---|---|
| reason | string | ContactUs Reason's reason | Yes |
| priority | integer | ContactUs Reason's priority | Yes |
| type | integer | ContactUs Reason's type | No |
| is_active | integer | ContactUs Reason's is active | No |
Success Response
{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": {
"id": "uuid",
"reason": "عميل",
"priority": 1,
"type": "COACH",
"isActive": false,
"problems": [
{
"id": "uuid",
"subReason": "frrfr",
"priority": 2,
"isActive": true,
"reasonId": "uuid"
}
]
},
"statusCode": 200
}
Error Response
Unauthorized (401)
{
"success": false,
"message": "يجب عليك تسجيل الدخول",
"data": [],
"statusCode": 401
}
Create ContactUs Reason With Sub Reasons
Endpoint
- Method: PATCH
- URL:
/v1/admin/contact-us-reasons/sub-reasons
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Request Body
| Parameter | Type | Description | Required |
|---|---|---|---|
| reason | string | ContactUs Reason's reason | Yes |
| priority | integer | ContactUs Reason's priority | Yes |
| type | string | ContactUs Reason's type | No |
| is_active | bool | ContactUs Reason's is active | No |
| sub_reasons | array | ContactUs Reason's sub_reasons is active | No |
| sub_reasons.sub_reason | string | ContactUs Reason's subReasons subReason | Yes |
| sub_reasons.priority | integer | ContactUs Reason's subReasons is priority | No |
| sub_reasons.is_active | bool | ContactUs Reason's subReasons is active | No |
Success Response
{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "uuid",
"reason": "عميل",
"priority": 1,
"type": "COACH",
"isActive": false,
"problems": [
{
"id": "uuid",
"subReason": "frrfr",
"priority": 2,
"isActive": true,
"reasonId": "uuid"
}
]
},
"statusCode": 200
}
Error Response
Unauthorized (401)
{
"success": false,
"message": "يجب عليك تسجيل الدخول",
"data": [],
"statusCode": 401
}
Recored Not Found (404)
{
"success": false,
"message": "لم يتم العثور على السجل",
"data": [],
"statusCode": 404
}
Update ContactUs Reason
Endpoint
- Method: PATCH
- URL:
/v1/admin/contact-us-reasons/{id}
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Request Body
| Parameter | Type | Description | Required |
|---|---|---|---|
| reason | string | ContactUs Reason's reason | No |
| priority | integer | ContactUs Reason's priority | No |
| type | string | ContactUs Reason's type | No |
| is_active | bool | ContactUs Reason's is active | No |
Success Response
{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "uuid",
"reason": "عميل",
"priority": 1,
"type": "COACH",
"isActive": false,
"problems": [
{
"id": "uuid",
"subReason": "frrfr",
"priority": 2,
"isActive": true,
"reasonId": "uuid"
}
]
},
"statusCode": 200
}
Error Response
Unauthorized (401)
{
"success": false,
"message": "يجب عليك تسجيل الدخول",
"data": [],
"statusCode": 401
}
Recored Not Found (404)
{
"success": false,
"message": "لم يتم العثور على السجل",
"data": [],
"statusCode": 404
}
Delete ContactUs Reasons
Endpoint
- Method: DELETE
- URL:
/v1/admin/contact-us-reasons
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Request Body
| Parameter | Type | Description | Required |
|---|---|---|---|
| ids | array | ContactUs Reasons's id | No |
Success Response
{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": [],
"statusCode": 200
}
Error Response
Recored Not Found (404)
{
"success": false,
"message": "لم يتم العثور على السجل",
"data": [],
"statusCode": 404
}