Status: Open
Status: Answered
Status: Closed
Status: Duplicate

CS16.2 REST API - how to use the tkl attribute validvalues 'attribute_values' parameter?

Posted Jan 13 by Thomas Bevan.

Hi all,

I'm trying to use the api/v1/tklattribute/validvalues call to return valid values for some cascading TKL attributes I have defined on a category. The call works great for the top level attribute, but I don't know what to put in the 'attribute_values' parameter to get it to work for the dependent attribute(s). The API Reference says it should be a "List of key value pairs of attributes", but no combination of known key value notation I've tried has worked (It just keeps saying "The attribute named 'TKL ONE' was not found though it was referenced in the definition of 'TKL TWO'.")

Could someone please give me an example of what the parameter expects?

Many Thanks,

1 Answer

BEST ANSWER: As chosen by the author.

Nevermind! It's just JSON. Here's a PowerShell example for anyone who finds this:

$attrvals = @{"19547355_2"="CORPORATE GOVERNANCE"} | ConvertTo-Json

$params = @{"attribute_key"="19547355_3";

Invoke-RestMethod -Method Post -Uri $cs/v1/tklattribute/validvalues -Headers @{"OTDSTicket" = $auth.ticket} -Body $params | ConvertTo-Json -Depth 10

 You have subscribed and will receive email notifications of updates to this topic. To unsubscribe, uncheck the checkbox.


Related categories

Related tags

Your answer

To leave an answer, please sign in.