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 …