Forum Discussion

mrkevanlin's avatar
7 years ago

APIs for group options menu

GroupPage and GroupMessagePage both have menus that contain "Subscribe", "Leave the group", "Bookmark" and other functions. Is there an API call to set these preferences? Idea here is to recreate these functions outside of the dropdown menu. 

  • mrkevanlin

    Yes, you can create a custom one using APIs. Here is the endpoint to get it done.

    <#assign target_url = http.request.parameters.name.get("target_url","") />
    <#assign board_id = http.request.parameters.name.get("board_id","") />
    <#if target_url?contains('remove') >
    	<#assign unsubscribe = restadmin("/boards/id/${board_id}/subscriptions/users/self/type/email/remove") />
    <#else>
    	<#assign subscribe = restadmin("/boards/id/${board_id}/subscriptions/users/self/add?subscription.type=email") />
    </#if>