Skip to main content

View Profile

This endpoint allows you to retrieve the user's profile information.

Request

Endpoint

  • Method: GET
  • URL: /api/users/profile

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer YOUR_API_TOKENYes

Success Response

{
"success": true,
"message": "Data has been retrieved successfully",
"data": {
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"avatar": "https://example.com/avatars/user.jpg",
"is_using_apple_private_relay_email": false,
"is_app_rated": true,
"is_app_rated_reminder": true,
"is_subscribed": true,
"profile": {
"phone": "+966500000000",
"gender": "MALE",
"marital_status": "SINGLE",
"date_of_birth": "1990-01-01",
"country_id": 1,
"nationality": 1,
"income_level_id": 2,
"education_level_id": 3,
"language_app": "ENGLISH",
"profile_progress": 80,
"reminders_per_day": 5,
"start_time": "09:00",
"end_time": "21:00",
"background_type": "AUTO"
},
"interests": [
{
"id": 1,
"name": "Technology"
}
],
"hobbies": [
{
"id": 1,
"name": "Reading"
}
]
},
"status_code": 200
}

Error Responses

Unauthorized (401)

{
"success": false,
"message": "Unauthenticated",
"data": null,
"status_code": 401
}

Invalid Token (401)

{
"success": false,
"message": "Invalid token",
"data": null,
"status_code": 401
}

Response Fields

FieldTypeDescription
idintegerUser's unique identifier
namestringUser's full name
emailstringUser's email address
avatarstringURL to user's profile picture
is_using_apple_private_relay_emailbooleanWhether user is using Apple's private relay email
is_app_ratedbooleanWhether user has rated the app
is_app_rated_reminderbooleanWhether to show app rating reminder
is_subscribedbooleanUser's subscription status
profileobjectUser's detailed profile information
profile.phonestringUser's phone number in E.164 format
profile.genderstringUser's gender (MALE/FEMALE)
profile.marital_statusstringUser's marital status (SINGLE/MARRIED/OTHER)
profile.date_of_birthstringUser's date of birth (YYYY-MM-DD)
profile.country_idintegerID of user's country
profile.nationalityintegerID of user's nationality
profile.income_level_idintegerID of user's income level
profile.education_level_idintegerID of user's education level
profile.language_appstringPreferred app language (ENGLISH/ARABIC)
profile.profile_progressintegerProfile completion percentage (0-100)
profile.reminders_per_dayintegerNumber of daily reminders
profile.start_timestringReminder start time (HH:mm)
profile.end_timestringReminder end time (HH:mm)
profile.background_typestringBackground preference (AUTO/FIXED)
interestsarrayList of user's selected interests
hobbiesarrayList of user's selected hobbies

Example Implementation Flow

  1. Get the user's API token from storage
  2. Add token to request header as Bearer token
  3. Make GET request to /api/users/profile
  4. Upon success:
    • Store user profile data in local state
    • Update UI to reflect user information
    • Calculate and display profile completion percentage
  5. Upon error:
    • If unauthorized, redirect to login
    • Display appropriate error message to user