GET /profile
Protected: true
Returns the user profile.
Nothing.
HTTP code: 200
{
"data": {
"kind" : "UserProfile",
"id" : 1,
"name" : "John Doe",
"email" : "[email protected]",
"updatedAt": null,
"createdAt": "2014-09-29T19:10:15Z"
}
}
None.
PUT /profile
Protected: true
Updates user profile.
{
"name": "JDoe"
}
name
obligatory. Validated with user.name rule.
HTTP code: 200
{}
- 400
ValidationError
PUT /profile/password
Protected: true
Updates user password.
{
"currentPassword": "password",
"newPassword" : "qwerty",
"newPasswordConfirmation": "qwerty"
}
currentPassword
obligatory. Validated with password rule.newPassword
obligatory. Validated with password rule.newPasswordConfirmation
obligatory. Must be equal tonewPassword
.
HTTP code: 200
{}
- 400
ValidationError
- 401
IncorrectPassword
POST /profile/email-update-request
Protected: true
Puts a request to update the user email. When a user wants to update his email it is not inmediate. First, a request is placed and an email is sent to the new address. In the email, there is a link to update the email.
{
"password": "password",
"newEmail": "[email protected]",
"newEmailConfirmation": "[email protected]"
}
password
obligatory. Validated with password rule.newEmail
obligatory. Validated with email rule.newEmailConfirmation
obligatory. Must be equal tonewEmail
.
HTTP code: 201
{}
- 400
ValidationError
- 401
IncorrectPassword
- 409
DuplicateEmail
- 409
DuplicateRequest
PUT /profile/email/:token
Protected: true
Updates a user email.
:token
obligatory, validated with the token rule. Token sent by email.
HTTP code: 200
{}
- 400
InvalidToken
- 410
ExpiredEmailUpdateRequest