APIs & Integrations

EkramulHuq
Participant

CRM card id

SOLVE

Hi,

I would like to get the CRM card ID at the webhook/Data fetch url end so that I can process request accourding to source card id and return json accourdingly. Currently we can get query string as following:

 

https://example.com/demo-tickets?userId=12345&userEmail=testuser@example.com&associatedObjectId=7891...

 

If we can get the CRM Card ID in the query string, we can use single url for many cards.

Any solution?

 

0 Upvotes
2 Accepted solutions
Sean_Matthews
Solution
Participant

CRM card id

SOLVE

My first thought, @dennisedson and @EkramulHuq is that each Card is set up with it's own data fetch URL, so you should be able to pass along whatever you want to the URL. I haven't tried having the URL end in query params... try throwing a `?card_id=1234` at the end of your data fetch URL and see if that works?

But otherwise, depending on what you're using to manage your data fetch URL endpoint, you should be able to pass whatever you want into the URL string itself so that you can parse it out. We use node.js and express for everything, and it's fairly straightforward for us to pass in and pull out from the URL param.

 

Example would be: https://example.com/crm-extensions /{{card_id}} (https://example.com/crm-extensions/1235)

 

And then in your route logic, you would be able to parse the card id from the route param.

 

Also, I personally would go with a unique name, mostly because if you're like us and use multiple OAuth Apps to manage different environments (we have an OAuth App for local devdev, staging, and prod) then the CRM card IDs change per app. In that case, we usually pass in some identifier like: https://example.com/crm-extension/contact-tickets where "contact-tickets" is the string we're looking for in our route determine what data to return.

 

Hope that helps!

 

Best,
~Sean

View solution in original post

EkramulHuq
Solution
Participant

CRM card id

SOLVE

Thanks for your sean, it is working. I used card name instead of card id.

View solution in original post

3 Replies 3
EkramulHuq
Solution
Participant

CRM card id

SOLVE

Thanks for your sean, it is working. I used card name instead of card id.

dennisedson
HubSpot Product Team
HubSpot Product Team

CRM card id

SOLVE

Hey @EkramulHuq 

Are you still working on this?

Maybe @Sean_Matthews has some thought 😀

0 Upvotes
Sean_Matthews
Solution
Participant

CRM card id

SOLVE

My first thought, @dennisedson and @EkramulHuq is that each Card is set up with it's own data fetch URL, so you should be able to pass along whatever you want to the URL. I haven't tried having the URL end in query params... try throwing a `?card_id=1234` at the end of your data fetch URL and see if that works?

But otherwise, depending on what you're using to manage your data fetch URL endpoint, you should be able to pass whatever you want into the URL string itself so that you can parse it out. We use node.js and express for everything, and it's fairly straightforward for us to pass in and pull out from the URL param.

 

Example would be: https://example.com/crm-extensions /{{card_id}} (https://example.com/crm-extensions/1235)

 

And then in your route logic, you would be able to parse the card id from the route param.

 

Also, I personally would go with a unique name, mostly because if you're like us and use multiple OAuth Apps to manage different environments (we have an OAuth App for local devdev, staging, and prod) then the CRM card IDs change per app. In that case, we usually pass in some identifier like: https://example.com/crm-extension/contact-tickets where "contact-tickets" is the string we're looking for in our route determine what data to return.

 

Hope that helps!

 

Best,
~Sean