Contact Us
This section covers the endpoints for managing contact us functionality.
Available Endpoints
List Contact Reasons
Get a list of all available contact reasons.
Endpoint
- Method: GET
- URL:
/v1/coach/contact-us-reasons
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح",
"data": [
{
"id": "uuid",
"reason": "أواجه مشكلة في الدفع و الشراء",
"priority": 1
},
],
"statusCode": 200
}
Get Sub-Reasons
Get a list of sub-reasons for a specific contact reason.
Endpoint
- Method: GET
- URL:
/v1/coach/contact-us-reason/{reason}/contact-us-sub-reasons
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
Path Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| reason | string | Contact reason ID | Yes |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح",
"data": [
{
"id": "uuid",
"subReason": "لا يمكنني شراء باقة/جلسة",
"priority": 1
},
],
"statusCode": 200
}
Submit Contact Form
Submit a new contact form.
Endpoint
- Method: POST
- URL:
/v1/coach/contact-us
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Request Body
| Parameter | Type | Description | Required |
|---|---|---|---|
| contact_us_reason_id | string | Contact reason ID | Yes |
| contact_us_sub_reason_id | string | Contact sub-reason ID | No |
| message | string | Contact message | Yes |
| phone | string | User's Phone | Yes |
| string | User's Email | Yes | |
| name | string | Contact Name | Yes |
| attachments | array | Array of file attachments | No |
Success Response
{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": {
"id": "uuid",
"name": "Ahmed Mohammed",
"email": "mohdkndjk@gmail.com",
"phone": "999999999",
"contactUsReason": "أواجه مشكلة في الدفع و الشراء",
"contactUsSubReason": "لا يمكنني شراء باقة/جلسة",
"message": "string",
"attachments": null
},
"statusCode": 200
}
Error Response
Validation Error (422)
{
"success": false,
"message": "بيانات غير صحيحة",
"errors": {
"reason_id": ["The reason field is required"],
"sub_reason_id": ["The sub reason field is required"],
"message": ["The message field is required"]
},
"statusCode": 422
}
Overview
Contact Information
Each contact reason includes:
- Unique identifier
- Reason name
- Active status
- Priority for sorting
Each sub-reason includes:
- Unique identifier
- Sub-reason name
- Active status
- Priority for sorting
- Associated reason ID
Important Notes
- Reasons and sub-reasons are sorted by priority
- Only active reasons and sub-reasons are returned
- Contact form submissions require authentication
- Attachments are optional and must be valid file types
- Contact submissions are tracked with timestamps
- Contact data is managed through the admin panel
- Maximum file size for attachments is 5MB
- Supported file types: PDF, DOC, DOCX, JPG, PNG