Solved

OnCloud Error: "HTTP 403 Forbidden"


Userlevel 3
Badge +8

Hi All,

we’re runng APP10 UPD8 OnCloud and we get the error HTTP 403 Forbidden when trying to access an API. The API is registered in Aurena. With Postman it works good.

What can we do to solve this issue ?

Thanks.

icon

Best answer by luca.puccini 29 August 2021, 11:49

View original

This topic has been closed for comments

11 replies

Userlevel 7
Badge +16

Hi @luca.puccini ,

 

Please provide more details about

1.0 Which API are you going to access ?

2.0 How do you access the API ? You have mentioned that you do not have any issue with Postman. Then in which method you access the API

 

403  Forbidden error comes when there is a access issue

Userlevel 3
Badge +8

Hello,

Aurena:

Postman:

 

PHP program:

(1) This part is the declaration of the API that we want to use (the address is not visible) The variable $ask0 is the basic address, $ask2 is the query for obtaining the top 25 Part Numbers that start with 'RM1A' (same as Postman)
(2) This part is the initialization of the curl properties. The password is not visible.
(3) This is the real execution of the API. If there is an error, it is echoing the error, otherwise it is showing the results.

Thanks.

Userlevel 7
Badge +31

Hi @luca.puccini,

My guess is you are probably not including some headers Postman is sending in the request, since you are getting a 403 error.

In Postman, you can generate client code for you request in various languages. You can select PHP - cURL as the language and generate the code and then check it against the code you have written in your application to see if there is anything missing. 

You can find instructions on how to generate code snippets in Postman here:

https://learning.postman.com/docs/sending-requests/generate-code-snippets/

 

Eg:

 

Hope this helps!

Badge +1

Hi Charith, 

We just tested it and unfortunately it is still not working. 

What else could be the issue? Thanks in advance for your help

Miruna

Userlevel 7
Badge +16

Hi All,

 

Check whether the below post is helpful for this discussion.

 

Userlevel 3
Badge +8

Hi All,

 

Check whether the below post is helpful for this discussion.

 


Hello,

Yes, I saw that but the documentation is referring for accessing an Intranet server from the Internet, we’re looking at accessing OnCloud from Intranet.

Thanks anyway !!!

Userlevel 3
Badge +8

Hello,

The problem was in the DNS configuration of the server that we were using for accessing the api. Now it is working !!

Thanks to everybody who made suggestions.

Userlevel 7
Badge +31

Hi @luca.puccini,

Glad you were able to get it resolved! If you could share which changes you had to do in DNS configuration specifically, that would be helpful for someone who gets the same issue in the future. :)

 

Badge +2

Could you please tell me what might be the issue as we are also facing the same issue..While trying to send SMS to API we are getting the same error

The remote server returned an error: (403) Forbidden.

Userlevel 3
Badge +8

Could you please tell me what might be the issue as we are also facing the same issue..While trying to send SMS to API we are getting the same error

The remote server returned an error: (403) Forbidden.

Hello,

The first thing to do is to enable the API by AURENA. Then check if the server that you’re using to access the API can resolve the name of the server.

This was my trobleshooting.

Hope this helps.

Badge +1

This error indicates that the server has determined that you are not allowed access to the thing you've requested, either on purpose or due to a misconfiguration . It's probably because the site owner has limited access to it and you don't have permission to view it. The vast majority of the time, there's not much you can do to fix things on your (*client) end. There are four common causes for 403 Forbidden error (server side) . Here they are listed from most likely to least likely:

 

  • An empty website directory
  • No index page
  • Incorrect settings in the .htaccess file
  • Permission / Ownership error

 

If authentication credentials were provided in the request, the server considers them insufficient to grant access. The client SHOULD NOT automatically repeat the request with the same credentials. The client MAY repeat the request with new or different credentials. However, a request might be forbidden for reasons unrelated to the credentials.