"Sorry, an error occurred while processing this request" instagram api python-instagram - api

I'm using python-instagram library to get access to instagram api. But when I run my app (flask rest api application), my auth method which use InstagramAPI and get_authorize_login_url method raise 500 error:
raise OAuth2AuthExchangeError("The server returned a non-200 response for URL %s %s %s" % (url, response['status'], content))
OAuth2AuthExchangeError: The server returned a non-200 response for URL https://api.instagram.com/oauth/authorize?scope=basic&redirect_uri=http%3A%2F%2Fsocialservice.test.5-soft.com%3A8515%2Finstagram%2Fauth&response_type=code&client_id=c5095d88cee14bac91a9341e6e82ff8f 500 Sorry, an error occurred while processing this request.
In my local machine it works without any problems but in the production server with different IP I've got this problem.
I would be very appreciative if someone can help to solve me this problem
Thanks in advance,
Ron

Please clarify:
In my local machine it works without any problems but in the production server with different IP I've got this problem.
How can you be performing authorization on your local machine? Instagram's API requires a public url for redirect_uri.
Next, I haven't found any evidence to verify this, but I don't believe you can specify a custom port in your callback url (you've provided http://socialservice.test.5-soft.com:8515/instagram/auth).
Last, assuming it's your callback server that is the problem, that error usually occurs when you aren't returning the correct response back to Instagram. The server needs to echo out only the value of the GET parameter code as plaintext.
If I browse to here: http://socialservice.test.5-soft.com:8515/instagram/auth?code=test I get no response, which is likely the cause of your error.

Related

users api of geoserver

I was using geoserver api to create a new user for my application, after I upgraded my geoserver to 2.18.2 the same code doesn't work any more.
until now I used this route which was working absolutely fine:
http://geoserver:8080/geoserver/geofence/rest/usergroup/service/jdbc_userservice/users
If i still use this route, I get this error:
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Therefore I tried this route which I found in their api docs:
localhost:8080/geoserver/rest/security/usergroup/users
but I get this error:
Type Status Report
Message Forbidden
Description The server understood the request but refuses to authorize it.
any hint or docs about this issue will be appreciated.

Passing / and -- in url it's showing 403 Forbidden Error

When we request to google or any 3rd party API, in this return url we getting this type of code.
?code=4/rAERtRkfXf--
The server doesn't accept this type code and it's showing 403 forbidden Error.
When I am talking with server support they told me about the security issue and it's mod_security issue.
Can anybody help me to solve this type of issue?
Try doing str_replace('/','%2F',$your_url) before submitting it to the server

401 unauthorized error while creating object in back4app via Temboo

I am creating an object in parse (using back4app parse server for this).
I get the following error when I run the choreo in temboo.
A HTTP Error has occurred: The remote server responded with a status
code of 401. Typically this indicates that an authorization error
occurred while attempting to access the remote resource. The data
returned from the remote server was: {"error":"unauthorized"} . The
error occurred in the HTTPSend (Parse) step.
That 401 error might indicate that the Id or Keys are not correct. Maybe it could be a good idea to double check them.
Also, what is the host and path for the API Request that you're doing with Temboo (I'm not acquainted with it)? If you're not using the correct ones it might cause problems too.
Make sure you're reaching something like this:
https://parseapi.back4app.com/classes/Your_Class_Name

How to show the internal server errors to the user?

I am working in an API . I want to throw detailed error messages to the user. Now i am in a situation to decide what kind of error code should be sent or how to explain user if any error occurs in the application internally. For example if database connection fails , what kind of http status code i want to send to the user ?
Can anyone help ?
An HTTP status code generally refers to the status of the HTTP request itself, not the status of the application handling the request. Therefore, most server-side errors are covered by 500 Internal Server Error. Any additional info about the error should be described in the response body. For APIs, the response body will often be JSON or XML, so you can use those formats for your errors. Something like this:
HTTP/1.1 500 Internal Server Error
[headers]
{"status":"error", "message":"The request failed due to database connectivity."}
There are, however, two cases I can think of when you might want another status code. If the user has requested an API method that is not implemented, you might want a 501 Not Implemented, and when there is a temporary service outage, you can use 503 Service Unavailable.
More info about server-side status codes here.

Magento REST API not working in PHP

Whenever I try to call Magento's rest resources via PHP, I get an HTTP 500 Internal Server Error. My link is, in accordance to Magento's REST API, http://mymagento.com/api/rest/products.
Everything is set up properly and whenever I try to access it via the browser, the response is a page with the XML data I want. Same thing goes for the RESTClient plugin for Firefox.
I also get the internal server error whenever I try to do an authorised request as a customer.
Does anyone know why this is happening? I ran out of ideas an hour ago or so.
If you just got that problem (only) then,
500 errors in the HTTP cycle
Any client (e.g. your Web browser or our CheckUpDown robot) goes through the following cycle when it communicates with the Web server:
Obtain an IP address from the IP name of the site (the site URL
without the leading 'http://'). This lookup (conversion of IP name to
IP address) is provided by domain name servers (DNSs).
Open an IP socket connection to that IP address.
Write an HTTP data stream through that socket.
Receive an HTTP data stream back from the Web server in response.
This data stream contains status codes whose values are determined by
the HTTP protocol. Parse this data stream for status codes and other
useful information.
This error occurs in the final step above when the client receives an HTTP status code that it recognises as '500'. (Last updated: March 2012).
Fixing 500 errors - general
This error can only be resolved by fixes to the Web server software. It is not a client-side problem. It is up to the operators of the Web server site to locate and analyse the logs which should give further information about the error.