# Capturing API results in CRM Card extensions

**URL:** <https://community.hubspot.com/t/capturing-api-results-in-crm-card-extensions/67206>\
**Category:** APIs & Integrations\
**Created:** [October 15, 2022, 8:24am UTC](https://community.hubspot.com/t/capturing-api-results-in-crm-card-extensions/67206 "2022-10-15T08:24:21Z")\
**Posts on this page:** 3\
**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 15, 2022, 8:24am UTC](https://community.hubspot.com/t/capturing-api-results-in-crm-card-extensions/67206/1 "2022-10-15T08:24:21Z")

</div>

This is probably my limited JavaScript experience, but I can’t for the life of me get the results of API to process them in my CRM Card extension.

I have the following call:

`hubspotClient.apiRequest({method: 'GET',path: `/crm/v4/objects/contacts/51/associations/companies`,}).then(results => {let objResult = results.body.results;console.log(`the object is: ${objResult}`)});`

The private app log console tells me that objResult is undefined. I’ve run the API call in postman, and it works. I get the following structure:

`{"results": [{"toObjectId": 5188303066,"associationTypes": [{"category": "HUBSPOT_DEFINED","typeId": 1,"label": "Primary"},{"category": "HUBSPOT_DEFINED","typeId": 279,"label": null}]},{"toObjectId": 6367963345,"associationTypes": [{"category": "HUBSPOT_DEFINED","typeId": 279,"label": null}]}]}`

but for the life of me, I can’t acces it within the CRM card. Execution is fine. The Private App console tells me the API call goes through.

I’m sure I’m missing something obvious …

---

<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:** [October 17, 2022, 4:34pm UTC](https://community.hubspot.com/t/capturing-api-results-in-crm-card-extensions/67206/2 "2022-10-17T16:34:52Z")

</div>

Hey, @PAtlan 👋 Are you still experiencing this issue? I noticed you resolved a similar post over the weekend. If not, I am happy to assist as needed.

Best,

Jaycee

---

<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 17, 2022, 4:37pm UTC](https://community.hubspot.com/t/capturing-api-results-in-crm-card-extensions/67206/3 "2022-10-17T16:37:23Z")

</div>

thanks Jaycee, yes, I’m good actually - IIRC, I hadn’t understood I needed to add .json() at the end of the returned object to be able to access it …
