# Calling API (GET request) from workflow custom code action

**URL:** <https://community.hubspot.com/t/calling-api-get-request-from-workflow-custom-code-action/49566>\
**Category:** APIs & Integrations\
**Tags:** workflows, developer-tools\
**Created:** [January 11, 2022, 3:30pm UTC](https://community.hubspot.com/t/calling-api-get-request-from-workflow-custom-code-action/49566 "2022-01-11T15:30:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisChiha](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/chrischiha/32/90510_2.png) [@ChrisChiha](https://community.hubspot.com/u/ChrisChiha)\
**Post date:** [January 11, 2022, 3:30pm UTC](https://community.hubspot.com/t/calling-api-get-request-from-workflow-custom-code-action/49566/1 "2022-01-11T15:30:25Z")

</div>

Hello,  
I want to do an API call from a custom code inside a deal based workflow to look for the contact in this deal that has a certain contact type.

Will use this get api :  
[https://api.hubapi.com/contacts/v1/search/query?q=testingapis&hapikey=demo](https://api.hubapi.com/contacts/v1/search/query?q=testingapis&hapikey=demo)  
How can i call this api from my custom code action and add the property to it ?  
Thanks,

Chris

---

<div class="post-metadata">

**Author:** ![ChrisChiha](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/chrischiha/32/90510_2.png) [@ChrisChiha](https://community.hubspot.com/u/ChrisChiha)\
**Post date:** [January 14, 2022, 10:15am UTC](https://community.hubspot.com/t/calling-api-get-request-from-workflow-custom-code-action/49566/2 "2022-01-14T10:15:07Z")

</div>

I was able to fetch a contact by adding his email as a property in the deal, and then calling this property from the enrolled deal using my custom code. This way i didn’t require any sort of API to fetch the contact email. Stored the email in a variable and will use this variable as a parameter in the enroll API.

My next step will be to figure out how to enroll this email that i fetched in a new workflow using the enroll API.
