Перейти к основному содержимому

Edit Profile API

POST /editProfile

Description

This API endpoint allows users to edit and update their profile information. The user can update details such as their name, contact information, address, and birth date.

Request Body

The request utilizes GraphQL to perform the editProfile mutation.

Mutation:

mutation editProfile ($userProfile: UserProfileEdit) {
editProfile (userProfile: $userProfile) {
firstName
lastName
phone
address
city
country
postalCode
birthDate
}
}

Variables:

{
"userProfile": {
"firstName": "<First_Name>",
"lastName": "<Last_Name>",
"phone": "<Phone_Number>",
"address": "<Street_Address>",
"city": "<City>",
"country": "<Country>",
"postalCode": "<Postal_Code>",
"birthDate": "<YYYY-MM-DD>"
}
}
  • userProfile (UserProfileEdit Object): An object containing the user's updated profile information.
    • firstName (String): The user's first name.
    • lastName (String): The user's last name.
    • phone (String): The user's phone number.
    • address (String): The user's street address.
    • city (String): The city where the user resides.
    • country (String): The user's country of residence.
    • postalCode (String): The postal code of the user's address.
    • birthDate (String): The user's birth date in the format YYYY-MM-DD.

Response:

  • Success (200 OK):

    {
    "data": {
    "editProfile": {
    "firstName": "<First_Name>",
    "lastName": "<Last_Name>",
    "phone": "<Phone_Number>",
    "address": "<Street_Address>",
    "city": "<City>",
    "country": "<Country>",
    "postalCode": "<Postal_Code>",
    "birthDate": "<YYYY-MM-DD>"
    }
    }
    }
    • The response returns the updated profile information, reflecting the changes made by the user.
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid data, missing fields, or server errors.

Note:

Ensure that all required fields are provided and that the data is correctly formatted, especially for fields like birthDate, postalCode, and phone. The profile data should be valid and in accordance with the platform's user profile requirements.