Looking to activate OAuth2 with API 8

I’ve made it as far as setting up OAuth Keys and am looking to call my first GET request.

In the documentation, the first GET URL request is listed as

{{your-SuiteCRM-url}}/V8/module/Accounts/11a71596-83e7-624d-c792-5ab9006dd493?fields[Accounts]=name,account_type

When navigating to this address - V8/modules/Accounts/KEY does not exist and returns an error. In fact, in my version of the project, V8 exists in the folder API and does not have a path to modules/Accounts.

I’m wondering if, since the documentation was written, the paths have changed or that this part of the documentation required updating.

Those URLs get rewritten in .htaccess and are all processed by the Api code, they don’t need to match directories and files.

Thanks for the reply prg. I was unaware that the .htaccess file in the project would change some of the routes.

The response I get when I try to access the API endpoint in postman is a 404 error and looks like the screenshot attached to this post. Do you have any idea what I might be doing wrong that’s causing this error?

What is your SuiteCRM version? There were some htaccess problems in 7.11.8 and 7.11.9 (if I remember correctly).

The version of SuiteCRM that I am using is 7.11.10. Do you know if this version is affected? Where would be the best place to start debugging?

You can try running a Admin / Repairs / Rebuild .htaccess, but if that doesn’t change anything, it’s likely you’re just not calling the API right.

Now, I never used the API myself, I’m not very good at helping out with these issues, sorry…

I ran a .htaccess repair and I’m still receiving the same problem.

I just noticed you’re using an Id from our Docs… that doesn’t work because that is not an actual Account id in your system. If you’re just trying the API to learn it, go in your database and grab a real id from your “accounts” table. Or use one of the search/list functions on the API to get them.

Hi prg,

I took an ID from the accounts table in my database and tried it with my API and again got a 404 error. Are you aware of any issue that might be causing this error? Whether it’s the postman set up or an issue with the setup on the application?

I’m afraid I really don’t know much about tha API. If somebody else comes in this thread, please help.

It might be a login problem, or something else. Can you get valid data from other API requests?

I have opened another thread about using the v4 API. I can access the SOAP API via a PHP script, but not in postman.

Ideally what I would like to do is create my own API that adds rows to the employees table in addition to what comes from the database.

I think the API is extensible - though I don’t know how to extend it. Also, if you add methods that are useful for everybody you can go ahead and post them as a PR to the core code. B-)