# CRM Cards - API calls

**URL:** <https://community.hubspot.com/t/crm-cards-api-calls/67189>\
**Category:** APIs & Integrations\
**Tags:** enterprise\
**Created:** [October 14, 2022, 7:22pm UTC](https://community.hubspot.com/t/crm-cards-api-calls/67189 "2022-10-14T19:22:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PAtlan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/patlan/32/42298_2.png) [@PAtlan](https://community.hubspot.com/u/PAtlan)\
**Post date:** [October 14, 2022, 7:22pm UTC](https://community.hubspot.com/t/crm-cards-api-calls/67189/1 "2022-10-14T19:22:18Z")

</div>

Hi,

I’m trying to set up a custom card using the new CRM Development beta tools. Expanding on the sample project, I want to call the Hubspot API to get data (specifically, associated object properties) from the record on which the CRM Card is read. (Iniitally, I just want to read the Name and Record ID of the primary associated company)

The sample project shows a simple API call to zenquotes, a public API, and I can’t find any discussion of authentication methods for the CRM cards.

I thought of using my account’s API key but these are soon to be deprecated.

I’m assuming because my CRM project sits in it’s own private app, that’s the way to go? But a sample piece of code would do wonders, because my poor attempts have gotten me nowhere!

Thanks for any help.

Paul.

---

<div class="post-metadata">

**Author:** ![PAtlan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/patlan/32/42298_2.png) [@PAtlan](https://community.hubspot.com/u/PAtlan)\
**Post date:** [October 15, 2022, 8:17am UTC](https://community.hubspot.com/t/crm-cards-api-calls/67189/2 "2022-10-15T08:17:09Z")

</div>

I’ll reply to my own post for future reference, as further digging allowed me to find how to set up API calls inside a card: the process is described in the docs,

`https://app-eu1.hubspot.com/docs/{hubspot instance}/doc/platform/serverless-functions `

(obviously replace with your instance number)

It seems each project saves its token in variable PRIVATE\_APP\_ACCESS\_TOKEN

so instanciating a hubspot Client like this:

`const hubspotClient = new hubspot.Client({accessToken: context.secrets.PRIVATE_APP_ACCESS_TOKEN,});`

works perfectly well!

---

<div class="post-metadata">

**Author:** ![kvlschaefer](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kvlschaefer/32/71076_2.png) [@kvlschaefer](https://community.hubspot.com/u/kvlschaefer)\
**Post date:** [October 17, 2022, 12:40pm UTC](https://community.hubspot.com/t/crm-cards-api-calls/67189/3 "2022-10-17T12:40:45Z")

</div>

Thanks for sharing this update with us, @PAtlan!

---

<div class="post-metadata">

**Author:** ![sejal\_parikh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sejal_parikh/32/41764_2.png) [@sejal\_parikh](https://community.hubspot.com/u/sejal_parikh)\
**Post date:** [January 6, 2023, 3:08am UTC](https://community.hubspot.com/t/crm-cards-api-calls/67189/4 "2023-01-06T03:08:39Z")

</div>

Hello Paul, your finding is spot-on. In the future, using this community group would get you quicker answers [https://community.hubspot.com/t5/CRM-Development-Tools-Beta/gh-p/crm-development-tools-beta](https://community.hubspot.com/t5/CRM-Development-Tools-Beta/gh-p/crm-development-tools-beta)

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [January 9, 2023, 5:23pm UTC](https://community.hubspot.com/t/crm-cards-api-calls/67189/5 "2023-01-09T17:23:50Z")

</div>

Thanks, [@sejal\_parikh](https://community.hubspot.com/t5/user/viewprofilepage/user-id/384808) 👋 Hey, @PAtlan just want to make sure you saw this 👀 — Jaycee
