Sometimes we see forbidden issue while access REST API of SugarCRM or SuiteCRM in outside program file or in customer portal or somewhere else.
Personally I felt sometimes and found many people suffered from this issue. I saw various question related to forbidden 403 issue in calling rest API into outside application.
There can be several reasons. SuiteCRM use SugarCRM API and it comes with some predefined exceptions. For 403 there are 3 exceptions defined in Sugar
So now we can check things as per exceptions defined above. We can check and fix if credential passed for login and authentication are proper and correct or blocked by admin etc.
I found sometimes that there is no issue in all above defined 3 reasons but still forbidden issue. Normally everything works fine, you are getting authenticating and getting session id for your next call. You can create new records into your CRM module via REST API.
But.. But.. But..
Problem start when you use the “get_entry” or “get_entry_list” methods and always getting Access Denied, forbidden 403 etc. get_entry method is used to get a single record from a module via API and get_entry_list is used for getting a list of records from a module with some conditions or all data.
The main reason of this issue is some parameters which we pass in curl request are wrong. For example
‘select_fields’ => array(),
In this parameter we are passing blank array. So just avoid such kind of things from your request parameters array. Things would be work.
This was my personal experience. First time it took some time to debug and found exact problem, and later I felt many where this kind of situations. This inspired to share this problem and small solution to all of you.
Your kind suggestions are welcome.