i’ve been trying for a while now to authenticate using the REST api V8 using the “password” grant type…it seems pretty straight forward ( very similar to sugarCRM). I have follow the guide [1] and been trying to get the access token using postman…the responses is a 200 but it return a login page [2] as the result.
i have to put it, otherwise it returns a status 500. Just to make sure i tried calling the /Api/access_token to the Demo CRM with a made up client_id and client_secret just to see what it returns and i got the same response as the picture a post it earlier (also using /index.php). if i take it out it gives a 500 status error
I think i was doing it wrong and it should be www.crm.com/suitecrm/Api/Access_token but now i keep getting a 404 error…after checking for a while i realize that this is a common problem but i cant find any the solution.
Hey @Mac-Rae,
Thanks for the response, I’ve tried what you mentioned following the JSON API guide, i also checked that rewriting is turned on (‘AllowOverride All’) in the .htacess file and the rewrites rules are set. After that i created the OAuth client (password grant type) in the UI (Admin->Oauth Clients)… when trying to test the endpoint http://www.crm.com/suitecrm/Api/Access_token but it gave me a 404 error.
Note: I am not sure if the cause of this error is from the installation i used( suiteCRM Bitnami self contained image)
So after following the documentation and reading different forums the right API endpoint should be {{suitecrm.url}}/Api/access_token but it is still giving me an error. This time a ‘500 internal server error’ an the error logs for the apache server /opt/bitnami/apache2/logs/error_log
I’m not sure if this error has to do with the last step of the doco, since it is not very clear but for what i understand, there are 2 places where the-same key (OAuth2 encryption key) should be.
I gave up on suiteCRM build with bitnami stack and decide it to install it and configured suitecrm on my own with:
ubuntu-bionic-18.04
Suitecrm Version 7.11.18
MariaDB
Composer 1.10
PHP 7.2
After All that (and the the Oauth2 docco) i was able to generate the bearer token… !!!
( great so now lets start calling different modules)…or so i thought so until i got 404 error when trying /Api/V8/{module} or/and /V8/{module}. For now i’m doing the testing using postman and i am including the bearer token in the header of the request (event if i didn’t it shouldn’t result on a 404 error).
Any way , i’ll keep posting my updates and if anyone has come across this error and has some insight please point me on the right path.
Make use of the Authorisation tab (Setting the option to OAuth 2) which has a nice interface for what your trying to do.
Upload the collection from the /Api/docs/postman/ folder which gives you some fun options to play with.
Copy the contents of the file found in /Api/docs/swagger/ into an online editor like https://editor.swagger.io/ which gives you and interactive and more details API Docs.
Hi all.
I’m having issues with using using the request in the Api. I can get a token but when i try to make any request, i get a strange behaviour. For example:
I make a GET to http://localhost:8080/V8/module/Accounts
and for response i get a 301 from Accounts and a 404 from module/index.php?action=Login&module=Users.
Are you using apache? also, make sure to follow the guide before calling endpoints and the rewrites. Also dont forget to create the oauth client in the user interface (make sure you include a client secret, leaving blank will result in a error).
And from your screenshot, try to get the access token first and the manually put bearer token (just to make sure you can get the access token Api/access_token.