Current User
Summary
The Current User REST API provides account management for the calling user
Description
With the Current User API, it is possible to view or modify the account properties of the calling user
Resources
| Resource | Since Version | Description |
|---|---|---|
| GET /api/portal/v1.3/currentuser/ | Get the current user | |
| PUT /api/portal/v1.3/currentuser/ | Modify the current user | |
| POST /api/portal/v1.3/currentuser/changepassword | Modify the current user's password |
GET /api/portal/v1.3/currentuser/
Summary
Get the current user
Description
Get the account details of the authenticated user
Parameters
none
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 401 | The caller cannot be authenticated |
| 403 | The caller is not allowed to access this resource |
| 500 | Internal Server Error |
Returns Class
PUT /api/portal/v1.3/currentuser/
Summary
Modify the current user
Description
Modify the account details of the authenticated user
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
- |
The API Manager user is a member of organizations. | User | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 401 | The caller cannot be authenticated |
| 403 | The caller is not allowed to access this resource |
| 500 | Internal Server Error |
Returns Class
Example
PUT https://localhost:8075/api/portal/v1.3/currentuser/
Request
{
"id" : "2be9fc6e-1110-474f-8029-bf1577ec3801",
"organizationId" : "6fb4bd38-199a-4e9f-8c11-43233f530d82",
"name" : "New User",
"description" : "Created by admin",
"loginName" : "jbloggs",
"email" : "jbloggs@acmecorp.com",
"phone" : "+353 (1) 6742000",
"mobile" : "+353 (89) 6742087",
"role" : "user",
"image" : "resources/photo.jpg",
"enabled" : true,
"createdOn" : 1367337125476,
"state" : "approved",
"type" : "internal",
"authAttrs" : null,
"surname" : "User",
"dn" : null
}Response
HTTP 1.1 200 OK{
"id" : "2be9fc6e-1110-474f-8029-bf1577ec3801",
"organizationId" : "6fb4bd38-199a-4e9f-8c11-43233f530d82",
"name" : "New User",
"description" : "Created by admin",
"loginName" : "jbloggs",
"email" : "jbloggs@acmecorp.com",
"phone" : "+353 (1) 6742000",
"mobile" : "+353 (89) 6742087",
"role" : "user",
"image" : "resources/photo.jpg",
"enabled" : true,
"createdOn" : 1367337125476,
"state" : "approved",
"type" : "internal",
"authAttrs" : null,
"surname" : "User",
"dn" : null
}
POST /api/portal/v1.3/currentuser/changepassword
Summary
Modify the current user's password
Description
Modify the password of the authenticated user
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
String | path | Required | ||
oldPassword |
The user's old password | String | form | Required | |
newPassword |
The user's new password | String | form | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 401 | The caller cannot be authenticated |
| 403 | The caller is not allowed to access this resource |
| 500 | Internal Server Error |