Emotional Map
Get information about emotional maps and manage user's emotional map subscriptions.
Get Emotional Map
Retrieve the current emotional map information including subscription status, notification times, and emotion tracking data. This endpoint provides essential data for initializing the emotional map feature and checking user's access permissions.
Endpoint
- Method: GET
- URL:
/api/emotional-map
Request Headers
| Header | Value | Required |
|---|---|---|
| Accept | application/json | Yes |
| Authorization | Bearer YOUR_API_TOKEN | Yes |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح",
"data": {
"emotional_map": {
"id": 1,
"name": "Emotional Map Name",
"description": "Emotional Map Description",
"is_vip": true,
"can_access": true,
"can_resubscribe": false
},
"subscription_status": "active",
"subscription_started_date": "2025-02-13",
"subscription_id": 1,
"notification_times": ["09:00", "15:00"],
"dates": [
{
"date": "2025-02-13",
"color": "#FFD700"
}
]
},
"status_code": 200
}
Get Emotion Choices
Get a list of available emotions, their sub-emotions, and emotion reasons that users can select from when logging their emotional state. Each emotion includes its type (positive/negative/neutral), color coding, and associated emoji.
Endpoint
- Method: GET
- URL:
/api/emotional-map/{id}/choices
URL Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | The ID of the emotional map |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح",
"data": {
"emotions": [
{
"id": 1,
"name": "Happy",
"color": "#FFD700",
"type": "positive",
"emoji": "/storage/emotions/happy.png",
"sub_emotions": [
{
"id": 1,
"name": "Joyful"
}
]
}
],
"emotion_reasons": [
{
"id": 1,
"name": "Work"
}
]
},
"status_code": 200
}
Error Responses
Unauthorized (401)
{
"success": false,
"message": "Unauthenticated.",
"data": null,
"status_code": 401
}
Server Error (500)
{
"success": false,
"message": "حدث خطأ في النظام",
"data": null,
"status_code": 500
}
Implementation Flow
-
User Authentication:
- Verify user's authentication token
- Check VIP status if required
-
Emotional Map Access:
- Check if emotional map exists and is active
- Verify user's subscription status
- Handle VIP access restrictions
-
Data Retrieval:
- Get emotional map details
- Load user's subscription data
- Format response with dates and notification times