Forum Discussion

akashm's avatar
akashm
Mentor
3 years ago

How to set predefined-only while creating GroupHub

So, I am in an interesting scenario:

  • I want to create a Group Hub --> Easy enough to create using the REST API Endpoints
  • I want to have Forum + Calendar + TKB created within the Group Hub --> Same as above
  • I want to make sure that the Boards under the Group Hub have `predefined-only` labels when creating topics on the boards. --> This seems not possible

 

What I tried doing was I tried using the Update Board API to enforce `allowed_labels` to `predefined-only` only to see that the API does not allow this change on Update.

 

So, my question is how do I set `predefined-only` for the boards under GroupHubs?

 

  • I did a little bit of testing, and I was able to set this setting using API v1 on an individual Idea Exchange within the Group Hub:

     

    GET /restapi/vc/boards/id/xxx/settings/name/label.allowed_labels
    * Returned "freeform-only"
    
    POST /restapi/vc/boards/id/xxx/settings/name/label.allowed_labels/set
    * value=predefined-only
    
    GET /restapi/vc/boards/id/xxx/settings/name/label.allowed_labels
    * Returned "predefined-only"

     

    After doing this, I did see the labels being enforced in the "New Idea" flow. I was not able to work with the group hub itself in API v1, and I did not get a chance to try API v2, but I assume that it would work in the same way.

    Let me know how that goes!

  • NarendraG's avatar
    NarendraG
    Khoros Alumni (Retired)

    akashm you are right, it is a limitation we do not allow board level settings to be administered while creating a GroupHub.

    However, as a work around you could use what AndrewF  has suggested or go to manage the internal individual board in admin portal --> Features --> Labels Settings and change it for now.

    We will try to internalise this suggestion.

  • AndrewF's avatar
    AndrewF
    Khoros Oracle

    Hi Akash, the key for this setting should be label.allowed_labels — does this prefixed key work when using the API?

    • akashm's avatar
      akashm
      Mentor

      hey AndrewF ,

      from what I can tell, this setting is not allowed for `Group Hubs` creation.

      It's allowed when I create a Forum (or any other board for that matter), but not Group Hub specifically

      • AndrewF's avatar
        AndrewF
        Khoros Oracle

        I did a little bit of testing, and I was able to set this setting using API v1 on an individual Idea Exchange within the Group Hub:

         

        GET /restapi/vc/boards/id/xxx/settings/name/label.allowed_labels
        * Returned "freeform-only"
        
        POST /restapi/vc/boards/id/xxx/settings/name/label.allowed_labels/set
        * value=predefined-only
        
        GET /restapi/vc/boards/id/xxx/settings/name/label.allowed_labels
        * Returned "predefined-only"

         

        After doing this, I did see the labels being enforced in the "New Idea" flow. I was not able to work with the group hub itself in API v1, and I did not get a chance to try API v2, but I assume that it would work in the same way.

        Let me know how that goes!