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

Asked by Matthew Magee on Thu 7/7/22 3:05 PM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Thu 7/7/22 4:02 PM

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

No feedback
That did the trick. Thanks! - Matthew Magee Thu 7/7/22 4:26 PM