Skip to main content

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

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer YOUR_API_TOKENYes

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

ParameterTypeRequiredDescription
idintegerYesThe 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

  1. User Authentication:

    • Verify user's authentication token
    • Check VIP status if required
  2. Emotional Map Access:

    • Check if emotional map exists and is active
    • Verify user's subscription status
    • Handle VIP access restrictions
  3. Data Retrieval:

    • Get emotional map details
    • Load user's subscription data
    • Format response with dates and notification times