Forum Discussion

csolis214's avatar
7 years ago
Solved

Common labels across the community

Not sure if this is the right place to post. It's easy to see all the labels applied to a given category/board. You can go to a page listing all topics that have that associated label. Example below...
  • VarunGrazitti's avatar
    10 years ago

    humbkr - You need to add a specific badge to the user when they post on a specific board, right? i.e. if they post in board X they get a badge named X_bdg and if they post in board Y they get a badge Y_bdg. To add to this, you'd want to add the badge even if they have posted in this board in the past, i.e. before your implementation.

     

    Here is the anwser to your queries:

     

    • How to trigger an action when a user posts a new message or create a new thread via the API ?

                   On the boards page, you can check using the API V2 if the user in context has any post in this board. Call for this would be:

     

    SELECT * FROM messages WHERE board.id = 'BOARD_ID' AND author.id ='AUTHOR_ID'

     

    If the size returned is > than 0, assign them the badge using next call. You can trigger this code in the page initialization tab in studio.

     

    • How to assign a role to a user via the API ?

                    http://community.lithium.com/t5/Community-API/bd-p/developers-rest-api?leaf-id=Role.users.add#Role.users.add

                   Ref: https://community.lithium.com/t5/Developers-Discussion/Add-User-Role-via-API/m-p/187996#M7689 

     

    • How to update the value of a custom user profile field via the API ?

                   /restapi/vc/users/id/[ID]/profiles/name/PROFILE_FIELD_NAME/set?value=VALUE_HERE

     

     

    I hope this helps.