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

Options

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,
Tom

Tagged:

Comments

  • 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";
    "version_number"="1";
    "attribute_values"=$attrvals
    }

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