Skip to main content

Get User Profile API

POST /userProfile

Description

This API endpoint retrieves detailed profile information about the currently authenticated user.

Request Body

The request utilizes GraphQL to perform the userProfile query.

Query:

query userProfile {
userProfile {
firstName
lastName
phone
address
city
country
postalCode
birthDate
}
}

Variables:

{}

Example Request:

curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query userProfile {\n userProfile {\n firstName\n lastName\n phone\n address\n city\n country\n postalCode\n birthDate\n }\n}","variables":{}}'

Response:

  • Success (200 OK):

    • The response contains detailed profile information about the authenticated user.
    {
    "data": {
    "userProfile": {
    "firstName": "<User_First_Name>",
    "lastName": "<User_Last_Name>",
    "phone": "<User_Phone>",
    "address": "<User_Address>",
    "city": "<User_City>",
    "country": "<User_Country>",
    "postalCode": "<User_Postal_Code>",
    "birthDate": "<User_Birth_Date>"
    }
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with retrieving the user profile data, such as authentication errors or server errors, the response will include an appropriate error message and status code.

Note:

Ensure the request is authenticated, as this query requires user authentication to return the correct profile details.