APIs & Integrations

mubaris
Member

How to identify which user has triggered a webhook?

Hi there! 

 

I have installed my app, which contains a webhook, in my test account. And whenever I add a contact to my test account, the webhook is triggered. 

 

My question is, there's no way I can identify which test account has triggered the webhook. Is there a way I can tell this?  For example, when the contact is added, can I get additional information like accessToken in the request object? 


Please note that I'm the request body I'm receiving is: 
[ { "eventId": 206178747, "subscriptionId": 327123, "portalId": 8688473, "appId": 231379, "occurredAt": 1603387436558, "subscriptionType": "contact.creation", "attemptNumber": 0, "objectId": 351, "changeFlag": "NEW", "changeSource": "CONTACTS" } ]

 

And the request headers are like this: 
{ "host": "mm-debug.azurewebsites.net", "x-client-ip": "54.174.54.83", "x-client-port": "34124", "connection": "Keep-Alive", "content-length": "224", "content-type": "application/json", "accept": "*/*", "max-forwards": "10", "user-agent": "HubSpot Connect 2.0 (http://dev.hubspot.com/) - WebhooksExecutorDaemon-executor", "x-hubspot-signature": "e0563bca0b07eab93d04924cbf1ffe45aeb1085b6bc54f92fab788af7d38bd56", "x-hubspot-signature-version": "v1", "x-hubspot-timeout-millis": "10000", "x-trace": "", "x-waws-unencoded-url": "/integrations/hubspot", "client-ip": "54.174.54.83:34124", "x-arr-log-id": "326f6188-374a-4c5b-8480-55d213f2ad39", "disguised-host": "mm-debug.azurewebsites.net", "x-site-deployment-id": "mm-debug", "was-default-hostname": "mm-debug.azurewebsites.net", "x-original-url": "/integrations/hubspot", "x-forwarded-for": "54.174.54.83:34124", "x-arr-ssl": "2048|256|C=US, S=Washington, L=Redmond, O=Microsoft Corporation, OU=Microsoft IT, CN=Microsoft IT TLS CA 5|CN=*.azurewebsites.net", "x-forwarded-proto": "https", "x-appservice-proto": "https", "x-forwarded-tlsversion": "1.2" }

 

 

From the request body and request headers, I cannot tell which app/user has triggered the webhook. Can you please share if there's a way to do this?

2 Replies 2
tjoyce
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

How to identify which user has triggered a webhook?

Trying to catch up here... 

Are you saying that your app on Azure allows HubSpot users to login on your Azure app and submit contacts to their HS Portal using the contact API? And you would like to know which user in your Azure app has created the contact?

Just a little confused on where a webhook comes into play in this flow

0 Upvotes
natsumimori
Community Manager
Community Manager

How to identify which user has triggered a webhook?

Hi @mubaris ,

Thank you for sharing your query in the HubSpot Community.

I wanted to tag in some subject matter experts here: @thesnappingdog and @tjoyce , would you be able to share some thoughts for @mubaris ?

0 Upvotes