Forum Discussion

roisinkirby's avatar
7 years ago

Pulling Community Badges / Stats / Ranks into our existing directory

Hi all,   Our business has an agency partner program, our full directory of HubSpot partners can be found here: https://www.hubspot.com/agencies Many of our partners are top contributors on our Co...
  • luk's avatar
    7 years ago

    roisinkirby You could either use API v1 or v2, they both support what you need, but generally it is advisable to use v2 for a variety of reasons, therefore I'll base my answer on REST API v2.

    To get all the information you mentioned (e.g.  badges, rank and number of solutions authored), you would do something like the following:

    SELECT solutions_authored.count(*), user_badges, rank.name FROM users WHERE id = '<userid>'

    See the docs here for more information: https://lithosphere.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv2&collection=users

    Regarding the "challenge" with mapping the community users to the CRM users: Yeah, that can be an issue and might involve some nice manual work (or semi-automated, depending what else could be leveraged from the CRM user objects to link users), I'd probably somehow store the community user ID into the CRM user object, but that doesn't really solve the initial mapping issue.

    If you need any development help with that project, let us know, that's the kind of stuff we do!