# Getting a ReferenceError; when trying to reference values in API Response

**URL:** <https://community.hubspot.com/t/getting-a-referenceerror-when-trying-to-reference-values-in-api-response/55989>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [May 1, 2022, 1:04am UTC](https://community.hubspot.com/t/getting-a-referenceerror-when-trying-to-reference-values-in-api-response/55989 "2022-05-01T01:04:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![glenFitted](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/glenfitted/32/32521_2.png) [@glenFitted](https://community.hubspot.com/u/glenFitted)\
**Post date:** [May 1, 2022, 1:04am UTC](https://community.hubspot.com/t/getting-a-referenceerror-when-trying-to-reference-values-in-api-response/55989/1 "2022-05-01T01:04:40Z")

</div>

I’m able to call ‘Get a contact by email address’, but am unable to reference response values for anything but the vid. I am sure it is a simple syntax error, but I am not seeing it 😞

```lia-code-sample
let response = UrlFetchApp.fetch('https://api.hubapi.com/contacts/v1/contact/email/testingapis@hubspot.com/profile?hapikey=demo');

let foo = JSON.parse(response);
console.log(foo)
console.log(foo.vid)
console.log(foo.is-contact)

```

vid logs as expected, but get “ReferenceError: contact is not defined” when trying to log is-contact via console.log(foo.is-contact).  
This is what is logged with console.log(foo):

```lia-code-sample
5:45:17 PM	Info	
{ vid: 12676274,
 'canonical-vid': 12676274,
 'merged-vids': [],
 'portal-id': 62515,
 'is-contact': true,
 properties: 
 { hs_analytics_last_url: 
 { value: 'https://share.hsforms.com/1A46BnFJiTBOFUIyr44xDCQ1c8j',
 versions: [Object] },
 hapikey: ........
.......

```

How do I reference the fields in single quotes (such as ‘is-contact’) in the response?

#

---

<div class="post-metadata">

**Author:** ![glenFitted](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/glenfitted/32/32521_2.png) [@glenFitted](https://community.hubspot.com/u/glenFitted)\
**Post date:** [May 1, 2022, 5:57pm UTC](https://community.hubspot.com/t/getting-a-referenceerror-when-trying-to-reference-values-in-api-response/55989/2 "2022-05-01T17:57:15Z")

</div>

This was indeed a simple syntax issue on my part. Simply need to add brackets --\> (foo[‘is-contact’]);
