REST Request to get Category info

Options

Hi,
I've looked through the various API's that have to do with category attributes, and I can't find one, where you enter the category ID and you get back just the category info, not actual values. Why would I need this? I'm building a Java API wrapper around REST that mimics what I can do today in Web Services, and one feature I need is to give the client the ability to specify the category as a name, and the attribute(s) as name/value pairs, and manage converting that into the appropriate REST. As I'm trying to minimize network traffic, I don't want to have to fetch the category info from the node itself each time, although I may have to. I was thinking of a lazy load idea where I manage to get the category info once, and reuse it.

<

p>
Having said all that, it appears that if the object being uploaded is being uploaded into a folder which doesn't have the particular category, I'd have to do an add operation (if I interpret the API specs correctly) as opposed to Web Services where I'd specify a metadata object which has the category payload I want (albeit it's a messy business).

<

p>
Question to OpenText: Am I correct in assuming that the only way you can get a category definition is if you retrieve it from an object which has the category already? What about the case where you know the category name but you don't have any information about it, and your calling application knows no details about any object in the system that has that category?

<

p>Thanks in advance

-Hugh Ferguson

Tagged:

Comments

  • So far no response from the field.

    <

    p>
    I have come up with one possible answer. I could use /api/v1/nodes/{category_id}/content, load the binary data into a byte array, then parse it. The Stringified Assoc is embedded so once you've located the first instance of A<?,... you should be able to parse it. That seems like a ridiculously long winded way of getting a category definition, when you don't know of a node that has the category - it would be far more sensible to extend the REST API to give you a category definition function, one that returns that definition assoc as JSON data. Ironically, in Government, given their wariness over custom code, they would probably prefer that solution to me writing a REST extension to do it properly. Go figure.

    <

    p>
    -Hugh

  • Hugh,

    I have had to do a pretty similar thing. I had to lazy load the category definitions then as I return each node into a list I have to rebuild an object and do this terrible bit of recursion to match the Id of the category to the actually property on the node. It is a mess but it works. Categories seem to be a massive blind spot to the Content Server. It seems like it is the only place to add custom "meta-data" to a node but using the Rest API you can't search on them and just getting back the display name of the category is way to difficult, requiring way to many requests to get a full picture of the node.