Update User Information

patch

/mobile/platform/users/{username}

Updates the currently authorized mobile user's information in Oracle Identity Cloud Service. You can update the firstName, lastName, and email properties as well as all the properties that are defined in the Oracle Identity Cloud Service User schema except for the username property.

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
Additional Properties Allowed: true
The mobile user data to modify. You can modify `firstName`, `lastName`, `email` and all the properties that are defined in Oracle Identity Cloud Service User schema except for username.
Show Source
Example Request (application/json)
{
    "lastName":"Smith",
    "urn:ietf:params:scim:schemas:idcs:extension:custom:User:custom_attribute":"1076270704",
    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:employeeNumber":"245562716",
    "email":"Smith12345@domain.xxx"
}
Back to Top

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
Additional Properties Allowed: true
The mobile user data to modify. You can modify `firstName`, `lastName`, `email` and all the properties that are defined in Oracle Identity Cloud Service User schema except for 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
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
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
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
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
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
}
Back to Top

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.

curl -i
-X PATCH 
-u joe: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: Mon, 28 Jan 2019 18:08:57 GMT

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": "f77873187f7d4e839a4cc8ca5db3e7ae",
    "username": "joe",
    "email": "joe@example.invalid",
    "firstName": "Joe",
    "lastName": "Doe",
    "links": [
        {
            "rel": "canonical",
            "href": "/mobile/platform/platform/users/joe"
        },
        {
            "rel": "self",
            "href": "/mobile/platform/platform/users/joe"
        }
    ],
    "attributes": {
        "idcsCreatedBy": {
            "type": "App",
            "display": "Client",
            "value": "Client_APPID",
            "$ref": "https://example.com/admin/v1/Apps/Client_APPID"
        },
        "id": "f77873187f7d4e839a4cc8ca5db3e7ae",
        "meta": {
            "created": "2017-02-26T14:00:06.907Z",
            "lastModified": "2019-01-28T18:08:59.470Z",
            "resourceType": "User",
            "location": "https://example.com/admin/v1/Users/f77873187f7d4e839a4cc8ca5db3e7ae"
        },
        "active": true,
        "displayName": "Joe Doe",
        "idcsLastModifiedBy": {
            "value": "d95ec1a6916943aebabe259cb69a7b6f",
            "display": "mobilecssexampledefaultinstance1",
            "type": "App",
            "$ref": "https://example.com/admin/v1/Apps/d95ec1a6916943aebabe259cb69a7b6f"
        },
        "userName": "joe",
        "urn:ietf:params:scim:schemas:oracle:idcs:extension:user:User": {
            "isFederatedUser": false
        },
        "emails": [
            {
                "primary": true,
                "value": "joe@example.invalid",
                "type": "work",
                "verified": false
            },
            {
                "primary": false,
                "value": "joe@example.invalid",
                "type": "recovery",
                "verified": false
            }
        ],
        "name": {
            "givenName": "Joe",
            "familyName": "Doe",
            "formatted": "Joe Doe"
        },
        "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
            "employeeNumber": "245562716"
        },
        "urn:ietf:params:scim:schemas:oracle:idcs:extension:userState:User": {
            "locked": {
                "on": false
            }
        },
        "urn:ietf:params:scim:schemas:idcs:extension:custom:User": {
            "custom_attribute": "1076270704"
        },
        "schemas": [
            "urn:ietf:params:scim:schemas:core:2.0:User",
            "urn:ietf:params:scim:schemas:oracle:idcs:extension:userState:User",
            "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User",
            "urn:ietf:params:scim:schemas:oracle:idcs:extension:user:User",
            "urn:ietf:params:scim:schemas:idcs:extension:custom:User"
        ]
    }
}
Back to Top