Update a user key value
/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
- application/json
- application/xml
-
id: string
The unique identifier of the object to be updated.
object
UserKeyValue
-
dateAdded(optional):
string(date-time)
The date when the UserKeyValue object was created.
-
dateModified(optional):
string(date-time)
The date when the UserKeyValue object was last modified.
-
key(optional):
string
The key associated with the UserKeyValue object. This field is related to the value field for a user. FAVORITES is an example key.
-
links(optional):
array links
-
recordId(optional):
string
The unique identifier that represents a userKeyValue resource.
-
userInformation(optional):
object UserKey
Title:
UserKey
-
value(optional):
string
The value associated with the UserKeyValue object. This field is related to the key field for a user. FAQ1, FAQ23, FAQ44 are example values.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
object
UserKey
-
email(optional):
string
Email of the User object
-
externalId(optional):
integer
The ExternalId is the Id of the corresponding User from an external system. It, along with ExternalType, can be used to bridge the gap between a User from this system and a User from an external system.
-
externalType(optional):
string
The ExternalType is the type of the corresponding User from an external system. It, along with ExternalId, can be used to bridge the gap between a User from this system and a User from an external system.
-
links(optional):
array links
-
name(optional):
string
User's full name
-
recordId(optional):
string
The unique record ID of the User object.
object
-
href:
string
URI [RFC3986] or URI Template [RFC6570]. If the value is set to URI Template, then the "templated" property must be set to true.
-
mediaType(optional):
string
Media type, as defined by RFC 2046, describing the link target.
-
method(optional):
string
HTTP method for requesting the target of the link.
-
profile(optional):
string
Link to the metadata of the resource, such as JSON-schema, that describes the resource expected when dereferencing the target resource..
-
rel:
string
Name of the link relation that, in addition to the type property, can be used to retrieve link details. For example, href or profile.
-
templated(optional):
boolean
Boolean flag that specifies that "href" property is a URI or URI Template. If the property is a URI template, set this value to true. By default, this value is false.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
Response
- application/json
- application/xml
200 Response
object
UserKeyValue
-
dateAdded(optional):
string(date-time)
The date when the UserKeyValue object was created.
-
dateModified(optional):
string(date-time)
The date when the UserKeyValue object was last modified.
-
key(optional):
string
The key associated with the UserKeyValue object. This field is related to the value field for a user. FAVORITES is an example key.
-
links(optional):
array links
-
recordId(optional):
string
The unique identifier that represents a userKeyValue resource.
-
userInformation(optional):
object UserKey
Title:
UserKey
-
value(optional):
string
The value associated with the UserKeyValue object. This field is related to the key field for a user. FAQ1, FAQ23, FAQ44 are example values.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
object
UserKey
-
email(optional):
string
Email of the User object
-
externalId(optional):
integer
The ExternalId is the Id of the corresponding User from an external system. It, along with ExternalType, can be used to bridge the gap between a User from this system and a User from an external system.
-
externalType(optional):
string
The ExternalType is the type of the corresponding User from an external system. It, along with ExternalId, can be used to bridge the gap between a User from this system and a User from an external system.
-
links(optional):
array links
-
name(optional):
string
User's full name
-
recordId(optional):
string
The unique record ID of the User object.
object
-
href:
string
URI [RFC3986] or URI Template [RFC6570]. If the value is set to URI Template, then the "templated" property must be set to true.
-
mediaType(optional):
string
Media type, as defined by RFC 2046, describing the link target.
-
method(optional):
string
HTTP method for requesting the target of the link.
-
profile(optional):
string
Link to the metadata of the resource, such as JSON-schema, that describes the resource expected when dereferencing the target resource..
-
rel:
string
Name of the link relation that, in addition to the type property, can be used to retrieve link details. For example, href or profile.
-
templated(optional):
boolean
Boolean flag that specifies that "href" property is a URI or URI Template. If the property is a URI template, set this value to true. By default, this value is false.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
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" }