Unknown Contacts Search API failure [400] - Recent Companies
SOLVE
Why is it that a call to companies/v2/companies/recent/modified would produce a error with the following message when a call to companies/v2/companies works without issue?
Unknown Contacts Search API failure: [400] {\"status\":\"error\",\"message\":\"User XXXXXXX does not have permissions on portal YYYYYY\",\"correlationId\":\"ff937528-07aa-4bf8-8708-89bc72b30dcf\"}
My company operates many integrations for users of HubSpot and out of all of them only two exhibit this behavior. At least according to the legacy API documentation all that is needed is the "contacts" scope. If the call is going to fail, I would expect both calls to fail and not just one.
Unknown Contacts Search API failure [400] - Recent Companies
SOLVE
You are correct. V2 still works, for now.
Reading up on the error code as well as understanding the software I would now guess thst the user (from your customers company) no longer has permission to access the portals companies.
Problem might be solved if they refresh their authentication with a user that has access to companies in their portal.
If I guess correctly you have set up so that your customer needs to sign in to get an access token and a refresh token. Even though you might be using a refresh token the user permission on these two accounts (for the user that you have the refresh token for) simply does not have access anymore.
Solutions: Revoke the access completely and make sure that your clients connects to your application with a user that has all necessary access needed.
OR
Make sure that your customer overlooks their user permissions.
Unknown Contacts Search API failure [400] - Recent Companies
SOLVE
That's correct. We have 74 customers that have linked HubSpot and only 2 of them exhibit this behavior. We use the /recent/modifed endpoint to do partial syncs. At night we perform full scans and those run to completion successfully but they don't utilize the /recent/modified endpoint during the full scan, so it appears to just be limited to this one endpoint.
It doesn't make sesne to me that this would be because v2 is "old". This code has been running fine for years and I can't easily switch to v3, so migrating is not a short term solution.
Unknown Contacts Search API failure [400] - Recent Companies
SOLVE
You are correct. V2 still works, for now.
Reading up on the error code as well as understanding the software I would now guess thst the user (from your customers company) no longer has permission to access the portals companies.
Problem might be solved if they refresh their authentication with a user that has access to companies in their portal.
If I guess correctly you have set up so that your customer needs to sign in to get an access token and a refresh token. Even though you might be using a refresh token the user permission on these two accounts (for the user that you have the refresh token for) simply does not have access anymore.
Solutions: Revoke the access completely and make sure that your clients connects to your application with a user that has all necessary access needed.
OR
Make sure that your customer overlooks their user permissions.
I am facing the exact same issue. For one some my customers, a call to `/companies/v2/companies/recent/modified` returns `Unknown Contacts Search API failure [400]`, `User XXX does not have permissions on portal XXX`. But calling `/companies/v2/companies/paged` returns a 200 and the data.
Is there any rational that could explain that strange behaviour ?
Unknown Contacts Search API failure [400] - Recent Companies
SOLVE
I would guess that it is because of usage of old api versions. Version 2 is no longer valid and in version 3 (current) of the hubspot api you will find companies under CRM > Objects > Companies. I am on my cellphone so cant really get a proper link to the documentation but google hubspot api objects and once you enter the documentation click ”endpoints” to get specifications