...
Code Block |
---|
HTTP/1.1 401 Unauthorized {"reason": "Not authorized."} |
API for User Profiles
Get your own profile
Code Block |
---|
GET https://repo-staging.sagebase.org/repo/v1/userProfile
|
returns the profile of the authenticated user:
Code Block |
---|
{
"firstName":"Jane",
"lastName":"Smith",
"userName","janesmith@sagebase.org",
"displayName":"Jane Smith",
"rStudioUrl":"http://rstudiohost.sagebase.org",
"ownerId":"1001",
"uri":"/userProfile",
"etag":"0"
}
|
Get another's profile
Code Block |
---|
GET https://repo-staging.sagebase.org/repo/v1/userProfile/1001
|
returns the profile of the specified user, where "ownerId" is the "id" field returned in the "/user" request, described above.
Note: Private fields (e.g. "rStudioUrl") are omitted unless the requestor is the profile owner or an administrator.
{
"firstName":"Jane",
"lastName":"Smith",
"displayName":"Jane Smith",
"ownerId":"1001",
"uri":"/userProfile",
"etag":"0"
}
Update your own profile
Code Block |
---|
PUT https://repo-staging.sagebase.org/repo/v1/userProfile
{
"firstName":"Jane",
"lastName":"Smith",
"userName","janesmith@sagebase.org",
"displayName":"Jane Smith",
"rStudioUrl":"http://rstudiohost.sagebase.org",
"ownerId":"1001",
"uri":"/userProfile",
"etag":"0"
} |
Note: The user associated with "ownerId" must match the identity of the authenticated user making the request, otherwise and Unauthorized response will occur.
Update another's profile
Code Block |
---|
PUT https://repo-staging.sagebase.org/repo/v1/userProfile/1001
{
"firstName":"Jane",
"lastName":"Smith",
"userName","janesmith@sagebase.org",
"displayName":"Jane Smith",
"rStudioUrl":"http://rstudiohost.sagebase.org",
"ownerId":"1001",
"uri":"/userProfile",
"etag":"0"
} |
Note: This API is available only to administrators.
More Examples
Add a particular user with full access and identified individuals with read-only access to a project.
...