APIs & Integrations

Not applicable

Pages API returns different response codes to different requesters

We are doing a simple GET request to the pages api like so:

GET https://api.hubapi.com/content/api/v2/pages/{page id}?hapikey={api key}

When we make this request from a cloud service in Azure, we occasionally receive a response of 403 Unauthorized. However, I can copy the same URL into my browser and get a valid response with data.

What could be causing one request to get a 403 and the other to be successful, even if the requests are seconds apart?

0 Upvotes
5 Replies 5
Not applicable

Pages API returns different response codes to different requesters

Our hosting provider is Microsoft as this is Azure. I don’t think we’ll have any luck having them look into the rest of the Azure clients. Perhaps blocking the IP address is too simple of a strategy.

0 Upvotes
Not applicable

Pages API returns different response codes to different requesters

@dadams any update on this?

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Pages API returns different response codes to different requesters

Those types of 403 errors are related to our application firewall. Their usually the result of a temporary block put in place when we see excessive or malicious traffic coming from a source. These blocks are temporary, and they’ll usually be removed shortly after the traffic goes back to normal.

If you’re still seeing these blocks after a few days, and you’re on a shared host, you may want to contact your hosting provider to make sure that another client isn’t creating excessive requests.

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Pages API returns different response codes to different requesters

Hi @ian-moore

Do you have an example of the body of one of those 403 responses? We normally have more details in the body of error responses.

0 Upvotes
Not applicable

Pages API returns different response codes to different requesters

Hi @dadams, here is an example response that I received today:

<HTML>
<HEAD>
<TITLE>Access Denied</TITLE>
</HEAD>
<BODY>
<H1>Access Denied</H1>
You don't have permission to access "http://api.hubapi.com/content/api/v2/pages/4933702052?" on this server.
<P>Reference #18.38781bb8.1497539630.2c79caac
</BODY>
</HTML>
0 Upvotes