Update a user key value

put

/km/api/v1/users/{userId}/userKeyValues/{id}

This method updates a UserKeyValue object having the specified user key value ID.

Example URI

The example URI for this method is as follows:

  • http://<IM_REST_API_HOST>/km/api/latest/users/{userId}/userKeyValues/{id}

    This request updates a UserKeyValue object having the specified user key value ID.

Response Errors

The possible error responses for this method are as follows:

  • OK-GEN0024

    The error occurs when the record Id of the specified UserKeyValue in the service request does not match the userKeyValue.recordId parameter value.

  • OK-GEN0005

    The error occurs in either of the following cases:

    • A user record for the specified ID does not exist.
    • The parameter values of userKeyValue.key, userinformation, or userinformation.reocrdId are null.

  • OK-GEN0012

    The error occurs when the userKeyValue.key parameter value is not same as the previously stored value.

  • OKDOM-USERKV0002

    The error occurs when the specified user record Id does not match the userinformation.recordId parameter value.

Request

Supported Media Types
Path Parameters
  • The unique identifier of the object to be updated.
Body ()
The object to be updated.
Root Schema : UserKeyValue
Type: object
Title: UserKeyValue
Show Source
Nested Schema : UserKey
Type: object
Title: UserKey
Show Source
Back to Top

Response

Supported Media Types

200 Response

OK.
Body ()
Root Schema : UserKeyValue
Type: object
Title: UserKeyValue
Show Source
Nested Schema : UserKey
Type: object
Title: UserKey
Show Source
Back to Top

Examples

The following example shows how to update the User Key Value object for the specified user ID by submitting a post request on the REST resource using cURL.

curl -X POST "https://<IM_REST_API_HOST>/km/api/latest/users/{userId}/userKeyValues/{id}" -u "<username:password>" -H "Accept: application/json" -H "Content-Type: application/json" -d "@<FilePath/RequestBody.json>"

Example of Request Body

The following example shows the contents of the request body in JSON format:

{
  "recordId" : "75F56044C4D94DC181CDA898D0F0B3E2",
  "userInformation" : {
    "recordId" : "62AE91CBB23A49668BC7B9A220B696C7",
    "name" : "User Name",
    "externalId" : 12345,
    "externalType" : "CONTACT",
    "links" : [ {
      "rel" : "canonical",
      "href" : "http://IM_REST_API_HOST/km/api/{version}/{resourceURI}",
      "mediaType" : "application/json, application/xml",
      "templated" : true,
      "method" : "GET",
      "profile" : "http://IM_REST_API_HOST/km/api/{version}/metadata-catalog/{resourceName}"
    } ]
  },
  "links" : [ {
    "rel" : "canonical",
    "href" : "http://IM_REST_API_HOST/km/api/{version}/{resourceURI}",
    "mediaType" : "application/json, application/xml",
    "templated" : true,
    "method" : "GET",
    "profile" : "http://IM_REST_API_HOST/km/api/{version}/metadata-catalog/{resourceName}"
  } ],
  "dateAdded" : "2013-04-23T20:06:43-0500",
  "dateModified" : "2017-03-28T14:48:21-0500",
  "key" : "FAVORITES2",
  "value" : "FAQ1,FAQ23,FAQ44"
}

Example of Response Body

The following example shows the contents of the response body in JSON format:

{
  "userInformation": {
    "recordId": "62AE91CBB23A49668BC7B9A220B696C7",
    "name": "User Name",
    "externalType": "ACCOUNT",
    "links": [
      {
        "rel": "canonical",
        "href": "http://IM_REST_API_HOST/km/api/latest/users/62AE91CBB23A49668BC7B9A220B696C7",
        "mediaType": "application/json, application/xml",
        "method": "GET"
      }
    ]
  },
  "recordId": "75F56044C4D94DC181CDA898D0F0B3E2",
  "links": [
    {
      "rel": "canonical",
      "href": "http://IM_REST_API_HOST/km/api/latest/users/62AE91CBB23A49668BC7B9A220B696C7/userKeyValues/75F56044C4D94DC181CDA898D0F0B3E2",
      "mediaType": "application/json, application/xml",
      "method": "GET"
    },
    {
      "rel": "collection",
      "href": "http://IM_REST_API_HOST/km/api/latest/users/62AE91CBB23A49668BC7B9A220B696C7/userKeyValues",
      "mediaType": "application/json, application/xml",
      "method": "GET"
    }
  ],
  "dateAdded": "2017-03-28T14:48:21-0500",
  "dateModified": "2017-03-28T14:48:21-0500",
  "key": "FAVORITES2",
  "value": "FAQ1,FAQ23,FAQ44"
}
Back to Top