I am trying to add a HighLevel connection via their OAuth2 workflow so I can access some of the other functionality in their docs that don’t work with the legacy API which is the key version that the prebuilt n8n credentials use…
I keep getting this error when I try it with the locationToken version as my “Access Token URL”:
#### Error: Unauthorized
More details
{"message":"version header was not found.","error":"Unauthorized","statusCode":401}
Failed to connect. The window can be closed now.
and this error when I try it with the agency version as my “Access Token URL”:
Error: Unprocessable Entity
More details
{"message":["client_id should not be empty","client_id must be a string","client_secret should not be empty","client_secret must be a string"],"error":"Unprocessable Entity","statusCode":422,"traceId":"bc8b7917-49fa-44e3-b851-58060ba2ff30"}
Failed to connect. The window can be closed now.
I can use either the agency or location url, it doesnt make a difference to me because I am ultimately trying to install this for multiple locations in my HighLevel instance.
The strange part is that the oauth part did work and I see my application installed in my HighLevel instance. The redirect is what is failing for sure.
I tried adding the version parameter from HighLevel to the “Auth URI Query Parameters” field in the credential setup but that also did not work.
Let me know what I should do, thanks!
Information on your n8n setup
n8n version: 1.38.1
Database (default: SQLite): Postgres
n8n EXECUTIONS_PROCESS setting (default: own, main): main
Running n8n via (Docker, npm, n8n cloud, desktop app): self hosted in gke
There are 2 other posts this week reporting something similar with this API I think. I would be happy to lend my credentials if you need them to debug.
It is weird API because of the Agency and Location authorization thing. I am available to help if you need anything.
The first error looks like it is possibly caused beucase you have not added the Version as a header to the HTTP request node which looks to be a requirement.
The second error seems to be because it is unhappy with the client id in the credential but I am not sure why.
Version Header Issue: I haven’t gotten to the HTTP request node yet; I’m still trying to save the OAuth2 credential via the credentials UI using a generic OAuth2 type. The error occurs on the n8n side after the authorization is granted in HighLevel but before it can be saved in n8n. On the HighLevel side, my application is visible, indicating that authorization was successful. However, the UI in n8n seems to indicate that the token wasn’t saved, preventing me from using the saved credential.
Version Parameter: This is required on the HighLevel side for the token urls. It should be a static value of version=2022-07-22 for the v2 API … I think putting that on the token url may have been how I got it to authorize my app but once it winds up back at n8n it dies.
Client ID Issue: The first error with the location API is the one I’m trying to resolve because it contains the features I need. The agency version is more suited for managing sub-locations, users, and administrative tasks. I guess they have separate token urls as well.
I may be misinterpreting something because their docs are pretty confusing. I think you may have to OAuth2 into an agency token, then request a location specific token via the agency token… or something? But if that is the case how would you even do that in n8n and save the resulting location credential?
I’ll try part 1 of that statement and report back.
If you have any recommendations or ideas on how to move forward, I would appreciate it. Let me know if I should try something specific.