APIs & Integrations

jedsmalloowd
Participant

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.
0 Upvotes
1 Accepted solution
MichaelC
Solution
Guide | Partner
Guide | Partner

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.


Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

View solution in original post

5 Replies 5
dennisedson
HubSpot Product Team
HubSpot Product Team

Unknown Contacts Search API failure [400] - Recent Companies

SOLVE

@jedsmalloowd 

That is a good question 🤔

I would expect the same @MichaelC , have you ever noticed this?

When you say only 2 exhibit this behavior, you mean that the rest are able to perform the exact same requests, but with no issue?

jedsmalloowd
Participant

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.

MichaelC
Solution
Guide | Partner
Guide | Partner

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.


Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

AMoreau
Member

Unknown Contacts Search API failure [400] - Recent Companies

SOLVE

Hi @MichaelC,

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 ?

Thanks 🙂  

0 Upvotes
MichaelC
Guide | Partner
Guide | Partner

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


Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas: