Writing Custom Attributes in Assets with API
Hello,
I'm trying to create an Asset with an API call from a workflow. I have got the system to create the asset, but it seems to be ignoring my custom attribute portion. Here is my body:
{
"AppID":130,
"Name":"{{Name}}",
"StatusID":"138",
"FormID":"1075",
"PurchaseCost":"0",
"Attributes":[{"Name":"Accessibility Rating","ID":"4381","Value":"8919"}]
}
The above returns a 201 Created message but the custom attribute isn't listed on the created asset. I've also tried the same code but without the "Name":"Accessibility Rating", portion.
Can you tell me what I've done wrong?
Matthew
Answer (1)
Hello Matthew,
Try it with your attributes line like so:
"Attributes":[{"ID":4381,"Value":8919}]
Note I've removed the quotes from around the numeric values of ID and Value. For an attribute that is choice-based, it is expecting a numeric Value to be passed, not a string which the presence of surrounding quotation marks would indicate it is a string value.
Sincerely,
Mark Sayers
Sr Support Consultant, CS