Retrieve User Information
/mobile/platform/users/{username}
Deprecated. Use Retrieve My Profile (GET /mobile/platform/users/me
) instead.
Retrieves information about the current user.
- When the user is a mobile user, this operation retrieves the user name, first name, last name, and email address.
- When the user is a virtual user, this operation retrieves the user name.
- When the user is a social user (that is, signed in using social identity), this operation retrieves the user's mobile ID and identity provider.
If you don't know the user name, then use ~
for the username
path parameter to indicate the current user.
Permissions
The authorized user can be a social user, virtual user, or a mobile user. If the authorized user is a mobile user, then the user must have a role that's associated with the mobile backend.
Request
-
username: string
The user name of the current user, which is the user in the
Authorization
HTTP request header. Use~
to indicate the current user. If you specify the user name, it must match the user name that's in theAuthorization
HTTP request header.
-
fields(optional): string
You can use this parameter to request a subset of the mobile user properties. This parameter doesn't apply to virtual or social users.
Example:
To retrieve only the properties
firstName
andlastName
for a mobile user, the call would pass the following query parameter:/mobile/platform/users/~?fields=firstName,lastName
The call returns a response like this:
{ "firstName": "Joe", "lastName": "Doe" }
Response
- application/json
200 Response
object
User Information
-
object Mobile User Information
Title:
Mobile User Information
Information that's returned when the current user is a mobile user. -
object Virtual User Information
Title:
Virtual User Information
Information that's returned when the current user is a virtual user. -
object socialUser
Additional Properties Allowed:
true
Information that's returned when the current user is a social user (that is, signed in using social identity).
object
Mobile User Information
-
email:
string
The email address for the user.
-
firstName:
string
The first name of the user.
-
id:
string
The unique identifier for the user.
-
lastName:
string
The last name of the user.
-
links:
array Links that each reference a single object.
Title:
Links that each reference a single object.
Minimum Number of Items:1
Unique Items Required:true
-
username:
string
Pattern:
[a-zA-Z0-9][a-zA-Z0-9\-_\.\@]*
The user name for the user.
object
Virtual User Information
-
username:
string
Pattern:
[a-zA-Z0-9][a-zA-Z0-9\-_\.\@]*
The user name for the user.
array
Links that each reference a single object.
1
true
-
[0]:
object pagingLink
A single link used for pagination.
object
true
-
facebook:
object facebook
Additional Properties Allowed:
true
Facebook social user information.
object
true
{
"firstName":"Joe",
"lastName":"Doe",
"links":[
{
"rel":"canonical",
"href":"/mobile/platform/users/joe"
},
{
"rel":"self",
"href":"/mobile/platform/users/joe"
}
],
"id":"295e450a-63f0-41fa-be43-cd2dbcb21598",
"email":"joe@example.com",
"username":"joe"
}
400 Response
The operation can't be performed.
-
Content-Type: string
The media type of the error message, which is
application/json
.
object
Error
-
detail:
string
Message that provides the error details.
-
o:ecid:
string
Execution context ID, which is a unique identifier to correlate events or requests that are associated with the same transaction across several components.
-
o:errorCode:
string
The service's error code.
-
o:errorDetails:
array o:errorDetails
Minimum Number of Items:
0
Included when the error is caused by multiple issues. -
o:errorPath:
string
The relative point in the API path where the error occurred.
-
status:
integer
HTTP status code. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more details.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
array
0
-
[0]:
object Error Detail
Title:
Error Detail
object
Error Detail
-
instance:
string
URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
The service's error code.
-
o:errorPath:
string
The relative point in the API path where the error occurred.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
{
"o:errorCode":"MOBILE-58060",
"detail":"Unable to use API virtualization for calls without any mobile backend context.",
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Cannot call API",
"o:errorPath":"/mobile/platform/users/joe",
"o:ecid":"cde040005cd5983e:4372d958:14c8c4c2d6c:-8000-000000000032b9d5, 0",
"status":400
}
401 Response
The operation can't be performed due to one of the following reasons:
- The user doesn't exist.
- The password is incorrect.
- The
Authorization
HTTP request header wasn't specified. - The user name doesn't match the user name in the
Authorization
HTTP request header.
-
Content-Type: string
The media type of the error message, which is
application/json
.
object
Error
-
detail:
string
Message that provides the error details.
-
o:ecid:
string
Execution context ID, which is a unique identifier to correlate events or requests that are associated with the same transaction across several components.
-
o:errorCode:
string
The service's error code.
-
o:errorDetails:
array o:errorDetails
Minimum Number of Items:
0
Included when the error is caused by multiple issues. -
o:errorPath:
string
The relative point in the API path where the error occurred.
-
status:
integer
HTTP status code. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more details.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
array
0
-
[0]:
object Error Detail
Title:
Error Detail
object
Error Detail
-
instance:
string
URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
The service's error code.
-
o:errorPath:
string
The relative point in the API path where the error occurred.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
{
"o:errorCode":"MOBILE-15209",
"detail":"401 - Unauthorized",
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Unauthorized",
"o:errorPath":"/mobile/platform/users/joe",
"o:ecid":"cde040005cd5983e:4372d958:14c8c4c2d6c:-8000-000000000033b51c, 0",
"status":401
}
403 Response
The operation can't be performed due to one of the following reasons:
- The user doesn't have a role that's associated with the mobile backend.
- The value of the
Authorization
HTTP request header that follows theBasic
or 'Bearer' authentication scheme is either missing or invalid.
406 Response
The MIME media type isn't supported. Only application/json
is supported. Either remove the Accept
header or specify a media type that's supported.
-
Content-Type: string
The media type of the error message, which is
application/json
.
object
Error
-
detail:
string
Message that provides the error details.
-
o:ecid:
string
Execution context ID, which is a unique identifier to correlate events or requests that are associated with the same transaction across several components.
-
o:errorCode:
string
The service's error code.
-
o:errorDetails:
array o:errorDetails
Minimum Number of Items:
0
Included when the error is caused by multiple issues. -
o:errorPath:
string
The relative point in the API path where the error occurred.
-
status:
integer
HTTP status code. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more details.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
array
0
-
[0]:
object Error Detail
Title:
Error Detail
object
Error Detail
-
instance:
string
URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
The service's error code.
-
o:errorPath:
string
The relative point in the API path where the error occurred.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
{
"o:errorCode":"MOBILE-92516",
"detail":"The MIME media type isn't supported, only application/json is supported. Either remove the Accept header or specify a media type that is supported.",
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Unsupported media type",
"o:errorPath":"/mobile/platform/users/joe",
"o:ecid":"cde040005cd5983e:4372d958:14c8c4c2d6c:-8000-000000000033ddba, 0",
"status":406
}
Examples
The following example shows how to get the values of the firstName
and lastName
properties that are associated with the current IDCS user by submitting a GET request on the REST resource using cURL. These are some of the user object properties that are defined for the realm that the user is a member of. You can get properties for the current user only. The ~
(tilde) gets the user name for the current user from the Authorization
header. For more information about cURL, see Use cURL.
curl -i -X GET -u mobile.user@example.com:password -H "Oracle-Mobile-Backend-ID: ABCD9278-091f-41aa-9cb2-184bd0586fce" https://fif.cloud.oracle.com/mobile/platform/users/~?fields=firstName,lastName
Example of Response Header
The following shows an example of the response header.
200 OK Content-Type: application/json Date: Thu, 18 Jun 2015 00:26:10 GMT
Example of Response Body for an IDCS User
The following example shows, in JSON format, the contents of the response body, which lists the requested properties (or all properties if no path parameters were specified):
{ "firstName": "mobile", "lastName": "user" }
Example of Response Body for a Social User
The following example shows, in JSON format, the contents of the response body when the current user is a social user:
{ "username": "1 :623:165", "mobileExtended": { "identityProvider": { "facebook": { "accessToken":"CAAI...YZD" } } } }