Hello,
I tried to batch create ~3k contacts. Successfully created 2,890 contacts but then the api failed with the error:
ForbiddenException: (403)
Reason: Forbidden
HTTP response headers: HTTPHeaderDict({'Date': 'Thu, 25 Apr 2024 14:00:54 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Content-Length': '4512', 'Connection': 'keep-alive', 'X-Frame-Options': 'SAMEORIGIN', 'Referrer-Policy': 'same-origin', 'Cache-Control': 'max-age=15', 'Expires': 'Thu, 25 Apr 2024 14:01:09 GMT', 'Report-To': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=NrpeFN%2B4eZENyg%2FDDHSxkPYn41CIbkSogb25Ouxv7fFcchRyJchWTL0Vu1NjXQTkijUO1ZHYk27CHc0nXfd%2FbvTX4AWJXI1fSUwcBUq8H7Al5FTs%2B8qr19ZLeQFLyKyp"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}', 'Vary': 'Accept-Encoding', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload', 'Server': 'cloudflare', 'CF-RAY': '879edcadcb7765d0-FRA'})
HTTP response body: <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![en...
Please advise on how to handle this.
The permissions that I have in the Private app are:
crm.objects.contacts.write
crm.schemas.contacts.write
crm.objects.contacts.read
crm.schemas.contacts.read
Hi, @Mobydick
I’d start by checking your Private App logs. You can also make a GET request to /account-info/v3/api-usage/daily/private-apps to review the daily API usage for all private apps in your HubSpot account. Are you using the batch Contacts API? If not, you might consider it as it can help avoid hitting rate limits depending on your use case — POST/crm/v3/objects/contacts/batch/create
Best,
Jaycee
Hi @Jaycee_Lewis
Yes, I am using the batch create /crm/v3/objects/contacts/batch/create and I also checked the daily usage which is not yet reached as you can see from the response:
{
"results": [
{
"name": "private-apps-api-calls-daily",
"usageLimit": 500000,
"currentUsage": 70,
"collectedAt": "2024-04-26T08:19:58.603Z",
"fetchStatus": "SUCCESS",
"resetsAt": "2024-04-27T04:00:00Z"
}
]
}
Also, in the private app logs, there is no log with the failed request. Why is that?
I can also see the failed requests in my app logs because I catch and print the error in the implementation.
Is it possible that the private app access token is expired?
How do you suggest I can resolve this?
@Jaycee_Lewis
Do you think we can have a solution by end of the day? This is kinda urgent.
Some updates to help:
I tried again the batch create. The first batch with 100 entries failed with the above error, the second batch with 100 entries and the third batch with 5 entries successsfully created the contacts.
Please advice as soon as possible.Thank you!