UpdateUser
Update the information of an existing user. action: updateimage - To update the image updateprofile - To update firstName, lastName and location updatedate - To update the date of birth updateemail - To update mail updatepass - To update the password
Query parameters
-
We send the action we want to do
Values are
updateimage,updateprofile,updatedate,updateemail, orupdatepass.
PUT
/users
curl \
--request PUT 'https://garden-to-yours.herokuapp.com/users?action=updateimage' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"lastName":"De los palotes","location":"Talavera de la Reina","firstName":"Pepito"}'
Request examples
Updateprofile
{
"lastName": "De los palotes",
"location": "Talavera de la Reina",
"firstName": "Pepito"
}
{
"dateOfBirth": "1985-10-02"
}
{
"image": "https://dominio.com/imagen/dasda.jpg"
}
{
"email": "newemail@hotmail.es"
}
{
"password": "newpassword"
}
Response examples (200)
{
"_id": "string",
"email": "user@example.com",
"image": "string",
"lastName": "string",
"password": "pa$$word",
"username": "string",
"firstName": "string",
"createDate": "2019-08-24",
"dateOfBirth": "2000-08-24T00:00:00.000Z",
"emailVerified": true
}