Hello I have a custom app that contains a card, this app is installed in multiple hubspot environments (this is placed on the Deal object), im using DataFetch to call out to my own system (not hubspot) and return some data to the card.
As part of the process my system (external to hubspot) needs to call back to the hubspot environment and retrive infomation befrore responding to the DataFetch request.
The issue im having is as far as i can tell there is no way on knowing with Hubspot environment the request came from, looking at the request paramaters there doesnt seem to be a way to pass an org / environment id in the DataFetch url (apart from hardcodeing it which would mean i need a new app for every hubspot environment).
Does anyone know a way i can identify the hubspot environemnt via a paramater / somthing passed in the DataFretch URL ?
Hubspot card - Accounts Dashboard | HubSpot
Hubspot request signature - HubSpot Developer Documentation - HubSpot docs
Hey @AppDev,
When you setup your CRM Card you should have specificed a data fetch URL. Which it sounds like you have done. When a record (in your instance a Deal) is loaded a GET request is made to this endpoint. It should include a number of properties in the query string as default. See below:
- associatedObjectID = The ID of the Object being loaded in the CRM
- associatedObjectType = The type of Object being loaded in the CRM
- portalID = the ID of the portal
- userEmail = The user accessing the record
- userID = The user id accessing the record
The “portalID” represents the account the request came from and could be used to return the appropriate information. Also this article might help you. It compliments the API documentation.
Hope this helps!