'Update Profile' Documentation - bounswe/2021SpringGroup7 GitHub Wiki

Description

This API functionality updates the information about a given user according to the body parameters given in request. The function for this endpoint is updateProfile(username), existing in the file profile.py. This functionality utilizes POST requests in our API and expects some obligatory body parameters to be able to work properly. These parameters are first name, last name, email, location, birthday and isVisible.

The URI of the API

If you try this API in our AWS EC2 instance,use
http://ec2-35-158-103-6.eu-central-1.compute.amazonaws.com:5000/api/user/{username}/update

If you try this API on our local machine, use
http://localhost:5000/api/user/{username}/update

Note that this functionality works only with POST requests.

Parameters

Path Parameters

This parameter is specified in the URI route.

username -> username of the user whose information is to be updated -> type: string

Body Parameters

These parameters are given in the body of the POST request.

first_name -> First name of the user -> type: string
last_name -> Last name of the user -> type: string
email -> Email of the user -> type: string
location -> Location of the user as any string -> type: string
birthday -> Birthday of the user as DD.MM.YYYY -> type: string
isVisible -> Visibility of the profile by other users -> type: boolean

Responses

HTTP_200_OK -> User information successfully updated. The API also returns the string 'Success' for confirmation.
HTTP_404_NOT_FOUND -> User with given username does not found in the database.
HTTP_500_INTERNAL_SERVER_ERROR -> Body parameters are not given properly to the POST request.