Update User Information

patch

/mobile/platform/users/{username}

Deprecated. Use the Oracle Identity Cloud Service to update user information.

Permissions

The authorized user must be a mobile user that has a role that's associated with the mobile backend.

Request

Supported Media Types
Path Parameters
  • 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 the Authorization HTTP request header.

Body ()
Root Schema : User Information to Modify
Type: object
Title: User Information to Modify
The mobile user data to modify. You can modify `firstName`, `lastName`, and `email`, but you can't modify `username`.
Show Source
Example Request (application/json)
{
    "lastName":"Smith",
    "email":"Smith12345@domain.xxx"
}

Response

Supported Media Types

200 Response

The user properties were updated successfully.
Headers
  • The media type of the object, which is application/json. This is the same media type that will be returned when the object is requested.

Body ()
Root Schema : User Information to Modify
Type: object
Title: User Information to Modify
The mobile user data to modify. You can modify `firstName`, `lastName`, and `email`, but you can't modify `username`.
Show Source
Example Response (application/json)
{
    "firstName":"Joe",
    "lastName":"Smith",
    "links":[
        {
            "rel":"canonical",
            "href":"/mobile/platform/users/joe"
        },
        {
            "rel":"self",
            "href":"/mobile/platform/users/joe"
        }
    ],
    "id":"295e450a-63f0-41fa-be43-cd2dbcb21598",
    "email":"Smith12345@domain.xxx",
    "username":"joe"
}

400 Response

The operation can't be performed due to one of the following reasons:

  • The user doesn't exist.
  • The content isn't a correctly formed JSON object.
  • The call used Basic Auth but the Oracle-Mobile-Backend-ID HTTP request header wasn't specified.
Headers
Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by the service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source
Example Response (application/json)
{
    "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.
Headers
Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by the service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source
Example Response (application/json)
{
    "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 either the Bearer or Basic authentication scheme is either missing or invalid.
  • The property can't be changed. For example, you can't change username.

404 Response

The operation can't be performed because we can't find the mobile backend.
Headers
Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by the service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source
Example Response (application/json)
{
    "o:errorCode":"MOBILE-58026",
    "detail":"We cannot find the active mobile backend for the given clientId fd4cc0cf-0a72-4ed6-aab6-295133b8904e and BASIC schema. Specify a valid clientId and try again.",
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Mobile Backend not found",
    "o:errorPath":"/mobile/platform/users/joe",
    "o:ecid":"cde040005cd5983e:4372d958:14c8c4c2d6c:-8000-000000000033b529, 0",
    "status":404
}

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 is supported.

Headers
Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by the service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source
Example Response (application/json)
{
    "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
}

415 Response

The MIME media type isn't supported or wasn't specified. Only application/json is supported.

Headers
Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by the service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source
Example Response (application/json)
{
    "o:errorCode":"MOBILE-92515",
    "detail":"The MIME media type isn't supported, only application/json is supported. 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-000000000033ba73, 0",
    "status":415
}

Examples

The following example shows how to update the current user's last name by submitting a PATCH request on the REST resource using cURL. 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 PATCH 
-u mobile.user@example.com:password
-d users.json
-H "Content-Type: application/json; charset=utf-8"
-H "Oracle-Mobile-Backend-ID: ABCD9278-091f-41aa-9cb2-184bd0586fce"
https://fif.cloud.oracle.com/mobile/platform/users/~

Example of Request Body

The following example shows the contents of the request body..

{
  "lastName": "Doe"
}

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
Oracle-Mobile-Runtime-Version: 15.4.1-201506162222

Example of Response Body

The following example shows, in JSON format, the contents of the response body, which lists all the basic property values for the user:

{
  "id": "23e77f1d-0def-483f-bc77-a7742cd155b6",
  "username": "mobile.user",
  "email": "mobile.user@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "links": [
    {
      "rel": "canonical",
      "href": "/mobile/platform/users/mobile.user"
    }
  ]
}