Forum Discussion

bcraft's avatar
bcraft
Contributor
7 years ago

API call to move group to different category

Hi,

I'm working with lilim and we are trying to automate moving groups from one category to another. I've automated moving messages from one board to another and was hoping this would be similarly straightforward. Sadly, it doesn't seem to be.

Has anyone done this? Am I missing something?

We have a large community with more than few groups that need to be re-categorized due to inactivity and we'd like to take care of these moves programmatically during hours when the community is less active.

Thanks!

Bart

  • AdamN's avatar
    AdamN
    Khoros Oracle

    Hi Bart,

    I've not tried it personally, but it looks like it should be possible via API v2. The "boards" collection supports an HTTP PUT (update) method with "parent_category" as a field:

    https://lithosphere.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv2&collection=boards#action-update

    So I suspect that if you were to make this call and pass in the desired category id, it should move the node.

    Give it a try, and if you have any issues be sure to let us know!

    • bcraft's avatar
      bcraft
      Contributor

      Thanks Adam!

      Here's some info that might not be obvious to everyone.

      When passing the parent_category it's not as simple as

      "parent_category":"CATEGORY ID"

      Instead, you need to pass type info as well

      "parent_category":{"type":"category","id":"[CATEGORY ID]"}

      otherwise it gets interpreted as null and moves the group to the root.

      Thanks again!

       

      • SuzieH's avatar
        SuzieH
        Khoros Alumni (Retired)

        Thank you bcraft. I'll be updating the example in the API reference.