APIs & Integrations

jp-ikhokha
Member

Get the Role of currently logged in user

SOLVE

Hi, just to confirm - at  present there is no way to get the Identity / Role of the currently logged in user either through an API call or through a  HUBL variable?

This is for an app built inside Hubspot, personalised functionality needs to be made available based on the logged in users role.

 

Thanks

 

JP

1 Accepted solution
Willson
Solution
HubSpot Employee
HubSpot Employee

Get the Role of currently logged in user

SOLVE

Hi @jp-ikhokha 

 

I can confirm that we do not currently provide any means of surfacing this information via the API or through the use of HubL at this time. 

 

Thanks!

Product Manager @ HubSpot

View solution in original post

5 Replies 5
ckhicks
Participant

Get the Role of currently logged in user

SOLVE

...more updates! We found this in the React <> HubSpot repo and it may do the trick: https://github.com/HubSpot/cms-event-registration/blob/master/src/event.functions/membership.js

 

Serverless functions to the rescue!

0 Upvotes
ckhicks
Participant

Get the Role of currently logged in user

SOLVE

Actually...this is exactly what I'm looking for: https://legacydocs.hubspot.com/docs/methods/contacts/get_contact_by_utk

 

Any hopes of this being in a recent version of the API?

ckhicks
Participant

Get the Role of currently logged in user

SOLVE

@krillewestling I have the same question...surely there's a filter for detecting a logged-in user, correct?

 

@Willson How else could you filter paid content to exclude bots/etc.? Like this, but in HubL: https://knowledge.hubspot.com/website-pages/require-member-registration-to-access-private-content

0 Upvotes
krillewestling
Member

Get the Role of currently logged in user

SOLVE

Hi @Willson!

 

My team need a way to show certain information only to logged in "site administrators" on individual blog posts. (CMS Hub Professional)

I guess that the user role is not that important at this stage. A simple "is_logged_in" hubl variable or something like that would be enough.

Is there no way to accomplish this? I'm hoping that I've just missed that information in the documentation. 🙂

 

Willson
Solution
HubSpot Employee
HubSpot Employee

Get the Role of currently logged in user

SOLVE

Hi @jp-ikhokha 

 

I can confirm that we do not currently provide any means of surfacing this information via the API or through the use of HubL at this time. 

 

Thanks!

Product Manager @ HubSpot