APIs & Integrations

Jun22
Participant

Display all deals on a page

Hello new to hubspot. 

{% set associated_deals = crm_associations( module.company.id, 'HUBSPOT_DEFINED', 6, 'limit=100&orderBy=event_date', 'dealname,event_date,hs_object_id,associated_contact_id') %} 


What im trying to get the output is display all the deals on a table and be clickable each item.  

Just like the image below with a list but its only a ticket listing .  Anyone can give me ideas or links for reference. Thanks

Jun22_0-1664637844729.png

 




0 Upvotes
7 Replies 7
ChehakWadhdwa
Member | Diamond Partner
Member | Diamond Partner

Display all deals on a page

Hey @Jun22

 

Hey there hit this curl code

curl --request GET \

  --url 'https://api.hubapi.com/crm/v3/objects/deals?limit=10&archived=false' \

  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

 

Check this link below for deals:

https://developers.hubspot.com/docs/api/crm/deals

 

0 Upvotes
Jun22
Participant

Display all deals on a page

Hello sir, Appreciate your response. 

Can you give me a sample raw code  for where can we  paste that "cUrl" and "YOUR_ACCESS_TOKEN"  is it on HTLM + HUBL module file sir. ? 

Hoping if you have a link with a tutorial on this would be love to check it sir 😞 

BTW, after pasting this code you given:  How to get all the leads to  display sir like table is it needs to have a line of codes to call the values right ?
----------------------------------------------------------------------------------------------

curl --request GET \

  --url 'https://api.hubapi.com/crm/v3/objects/deals?limit=10&archived=false' \

  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

---------------------------------------------------------------------------------------------



0 Upvotes
ChehakWadhdwa
Member | Diamond Partner
Member | Diamond Partner

Display all deals on a page

Hey @Jun22 

  Hit this code

var request = require('request');

var options = {

  'method': 'GET',

  'url': 'https://api.hubapi.com/crm/v3/objects/deals?limit=10&archived=false',

  'headers': {

    'authorization': 'Bearer YOUR_ACCESS_TOKEN'

  }

};

request(options, function (error, response) {

  if (error) throw new Error(error);

  console.log(response.body);

});

 

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

0 Upvotes
Jun22
Participant

Display all deals on a page

Hello sir is it to be paste in the HLTM + HUBL module at the javascript section ?

0 Upvotes
ChehakWadhdwa
Member | Diamond Partner
Member | Diamond Partner

Display all deals on a page

Hey @Jun22

 

yes, you can paste in HTML+HUBL using <script> paste snippet here</script> tag.



Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

0 Upvotes
Jun22
Participant

Display all deals on a page

Btw sir, Right now I tried to get the Owners Firstname and Lastname form deals information on this https://developers.hubspot.com/docs/api/crm/owners

Can you help me why my function https://testsite/_hcms/api/demo from serverless throws error like this "

{"error":"The endpoint GET demo has not been configured for portalID"}

 

ScreenShot Tool -20221010193025.png

ScreenShot Tool -20221010192736.pngScreenShot Tool -20221010192814.png

 

 

 

0 Upvotes
Jun22
Participant

Display all deals on a page

Hello sir,  can you give me some screenshot how it done ? I am confuse because I tried to paste your code here : 

var request = require('request');

var options = {

  'method': 'GET',

  'url': 'https://api.hubapi.com/crm/v3/objects/deals?limit=10&archived=false',

  'headers': {

    'authorization': 'Bearer YOUR_ACCESS_TOKEN'

  }

};

request(options, function (error, response) {

  if (error) throw new Error(error);

  console.log(response.body);

}); 

It throws "Require are not define." what am I missing sir . 

0 Upvotes