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 Community: community.hubspot.com

Is it possible to leverage Lithiums APIs to pull the following Community datapoints onto a partner's profile page:

- Badges
- Community Stats (specifically Accepted Solutions)
- Community Rank Name

If so - which API can be used, and how do I know if we have access to it? We have only used the Bulk Data API to date. 

One challenge to consider is the following: the partner directory database is built based on the 'Company' object in the CRM. Whereas the Community profiles are based on unique user email. 

Please note: I am not a developer, but will be taking details to our team to scope the project e.g. resources required / time to execute etc.

Thanks

 

 

  • 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!

  • 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!