# Calling API from T-SQL, getting 200 but blank request headers, blank response text

**URL:** <https://community.hubspot.com/t/calling-api-from-t-sql-getting-200-but-blank-request-headers-blank-response-text/32250>\
**Category:** APIs & Integrations\
**Tags:** companies\
**Created:** [February 24, 2021, 4:21pm UTC](https://community.hubspot.com/t/calling-api-from-t-sql-getting-200-but-blank-request-headers-blank-response-text/32250 "2021-02-24T16:21:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AVogg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/avogg/32/48852_2.png) [@AVogg](https://community.hubspot.com/u/AVogg)\
**Post date:** [February 24, 2021, 4:21pm UTC](https://community.hubspot.com/t/calling-api-from-t-sql-getting-200-but-blank-request-headers-blank-response-text/32250/1 "2021-02-24T16:21:23Z")

</div>

Hello,

I am attemping to extract companies from HubSpot by calling the API through a SQL Stored Procedure. I am connecting to HubSpot per the logs with HTTP status of 200, but the request headers and response are all blank. Here is my code:

 ![38589i5A2A56EE386A2A02.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/c/c9ef379fe7855a916efd404771c6218a66ce3fa1.png)

![]() ![]()

Any ideas on what I’m doing incorrectly?

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [February 24, 2021, 6:44pm UTC](https://community.hubspot.com/t/calling-api-from-t-sql-getting-200-but-blank-request-headers-blank-response-text/32250/2 "2021-02-24T18:44:47Z")

</div>

Hi @AVogg , on the surface, everything looks fine, but I have not used the same tools that you are.

Did you confirm it is working with something like postman?

@lynton , do you have any ideas?

---

<div class="post-metadata">

**Author:** ![lynton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lynton/32/31184_2.png) [@lynton](https://community.hubspot.com/u/lynton)\
**Post date:** [February 24, 2021, 10:19pm UTC](https://community.hubspot.com/t/calling-api-from-t-sql-getting-200-but-blank-request-headers-blank-response-text/32250/3 "2021-02-24T22:19:42Z")

</div>

Try adding the properties querystring parameter:

A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.

I’m not familiar with this T-SQL approach of calling the API. As a next step for troublehooting, I’d suggest installing Fiddler on the same machine as SQL Server. Then you can listen for the requests and see exactly what is being sent from your server to HubSpot.

---

<div class="post-metadata">

**Author:** ![AVogg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/avogg/32/48852_2.png) [@AVogg](https://community.hubspot.com/u/AVogg)\
**Post date:** [February 25, 2021, 1:09pm UTC](https://community.hubspot.com/t/calling-api-from-t-sql-getting-200-but-blank-request-headers-blank-response-text/32250/4 "2021-02-25T13:09:23Z")

</div>

Thanks for replies. I’ll try these suggestions today.

---

<div class="post-metadata">

**Author:** ![AVogg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/avogg/32/48852_2.png) [@AVogg](https://community.hubspot.com/u/AVogg)\
**Post date:** [February 25, 2021, 9:11pm UTC](https://community.hubspot.com/t/calling-api-from-t-sql-getting-200-but-blank-request-headers-blank-response-text/32250/5 "2021-02-25T21:11:22Z")

</div>

Well I got it to work, but I don’t really know why lol.

I changed my @responseText variable to be of type table:

DECLARE @responseText TABLE(responseJSON NVARCHAR(MAX));

and I inserted the responseText into that:

INSERT INTO @responseText exec sp\_OAGetProperty @token, ‘responseText’

and it works. but this seems like the exact same thing i was doing before. Oddly, the HubSpot page showing the request/response headers and body are still completely blank for me.

/shrug, i can make this work. thanks for the help!
