Request Return Invalid Client

hello after doing outh2 i’m trying to get the access token but i always get the reply “invalid client”.
This is my code.

I am not sure if the use of URLSearchParams is actually sending the data as query params, but if it is that needs to be sent in the body of the request not in the query string. Also client_id and client_secret should be sent as Basic Authentication header as described by the spec RFC 6749: The OAuth 2.0 Authorization Framework

Hello, I think that according to your documentation client_id and client_secret is only sent as an authentication header when you want to refresh an existing access token, which is not the case. Once again I explain, I already authenticated with the infusion soft account and returned the authorization code that I will use to obtain the access token for the first time. I’ve tried a thousand and one ways and I can’t get the token. (Another tip: Improve your API Documentation and above all post example code to help all developers who want to integrate your API.)

Client credentials need to be sent via either the authorization header via Basic Auth or in the post body using the keys client_id and client_secret. The spec expects them them in the basic auth header. If you can point me to where our docs state you can pass them in the query string please link it here so I can take a look and fix.