Forum Discussion

Claudius's avatar
5 years ago

href field of nodes collection does not return canonical path

The href of the nodes collection is documented as "The relative href to the resource. This is the canonical path to the resource relative to the Community API root." - Unfortunately what the API v2 in 19.9 returns is of an unusable (although readable format. For example the category

https://community.acme.com/t5/Discussions/ct-p/discussions 

Would return in the API call SELECT id, href, title, short_title FROM nodes WHERE node_type = 'category' just

"href" : "/nodes/category:discussions"

And as we all probably agree the following URL is not a valid community URL: https://community.acme.com/nodes/category:discussions 

Khoros: Can you confirm this is a bug? Or is there any way to easily convert this href value to a valid view_href?

    • Claudius's avatar
      Claudius
      Boss

      Argh! I didn't even know such thing as a community API root exists.

      I am right now building a navigation menu and thought the nodes collection would lend itself ideally for that. Unfortunately there is no view_href field in the collection I could use. That's a bummer since this collection is the only one exposing group hub nodes. They are neither returned in the boards nor the categories collections.

      Any other tips where I easily could get view_hrefs of group hubs alongside other node types? 

      • luk's avatar
        luk
        Boss

        Claudius you can get the view_href, just try it =)... (don't believe the docs):

         

        SELECT id, view_href, href, title, short_title FROM nodes WHERE node_type = 'category'

         

        EDIT: Maybe I got you wrong? Because view_href is definitely documented for the nodes collection.