Http Request OAuth2 SuiteCRM Error Access Denied

Hi everyone.
Im trying to access the API of SuiteCRM with the Http Request’s node, and i don’t know why, but always that i try to execute the node i receive this error.

The URL that im trying to connect is => https://[MyDomain]/api/v8/oauth2/access_token

And body’s parameters:

Hey @victormiranda!

Looking at the SuiteCRM documentation, it looks like you don’t have to provide the username and password. You can provide the Client ID and Secret or the Username and Password.

Looks like you can do username and password as well. Not need to use OAuth2 with grant type client credentials.

@harshil1712 @RicardoE105 Sorry for the inactivity.
I returned to this proyect, and i read all documentation and i see that you’tr right, i could auth the api with the username and password, but i don’t know why, but the error persist.

I’m sending this URL with POST method, and the credentials are right.

Hey @victormiranda,

Are you sure you have to pass the credentials in the query parameter? I couldn’t find any information on the credentials should be sent in their documentation.

I’m progressing, now I’m going through header and body parameters for the credentials.

Now I get an error from the authentication client, surely something is missing.

I already found the correct endpoint. It seems that it is different depending on the version of SuiteCRM, that was also one of the errors.

https://[URL]/api/oauth/access_token

I would suggest you try these out with a tool like Postman. Once you make it over there, you can easily replicate it in the HTTP Request node

I know the tool and I downloaded it, but I have never used it, if you tell me that it is very useful I will use it, thank you very much.

You have to enter your URL, and set header, query, and body parameters (if any) and make a request. You can change the HTTP Request method as well!

Also, according to the example in the docs the password has to be md5 hashed.

    'password' => md5('suitecrmpassword'),
1 Like

@RicardoE105 @harshil1712
Thanks for your help.
I solved the problem, i will post a guide for anyone that has the same problem.

1- You need to create an user to get the token, the user must be for OAuth2.

[Follow the Clients Credentials Grant Steps]

2- You need to found your endpoint of your API, i see that this depend of your proyect’s version, in my case is https://[My-Domain]/api/oauth/access_token

3- The HTTP Request Method need to be POST.

image

4- In body Parameters you will introduce the grant_type (client_credentials in this case), the client_id and the client_secret

image

5- When you executed your Node, if all run correctly, you will get your token access.

1 Like

Hey @victormiranda,

Thank you so much for sharing the solution! I am sure this is going to be helpful for anyone wanting to use SuiteCRM :slight_smile:

1 Like

You always help me, even if I don’t know much, I like to help as much as I can.
See ya.

1 Like