Patch people Custom attribute value
I have a custom Yes/No attribute created for the User profile. By default attribute do not have any value and attribute is not shown in API response when it is null.
I am trying to replace the custom attribute value using the following api.
https://rollins.teamdynamix.com/TDWebApi/api/people/{uid}
And I am using the below object as a body but getting error. Could someone help me solve this issue?
{
"op": "replace",
"path": "/attributes/3426",
"value": {
"Value": "4310",
"ValueText": "Yes",
"ChoicesText": "Yes"
}
}
Here is the Response:
{
"ID": -1,
"Message": "patch must not be null. Errors:\r\n* Exception Message: The JsonPatchDocument was malformed and could not be parsed."
}
Answer (1)
Hello Rakesh,
A PATCH call is an array of objects that specify particular operations to perform against one or more properties about (in this case) a ticket object.
Your syntax would appear to be inaccurate. If the goal is to set that attribute to use the choice with the ID of 4310, the syntax for the call's body should be as follows:
[ {"op": "replace", "path": "/attributes/3426", "value": "4310"} ]
Sincerely,
Mark Sayers
Sr Support Consultant, CS
[ {"op": "replace", "path": "/attributes/3426", "value": 4310} ]
it worked after making the value an integer instead of a string.
Thank you for all your help.
Rakesh - Rakesh Gunnam Mon 7/8/24 5:32 PM