Recieving 404 error when running get request to Amadeus low-fare-search API - amadeus

Hi I am very new to Angular and programming in general and I have been trying to query the Amadeus low-fare-search with Angular HTTPClient and failing, I have been looking around for answers, but havent found anything specific to this, I have found some answers related to the specific problem of "unable to identify proxy".
And according to some the reason for this is that the URL is incorrect.
But this is the URL on Amadeus page
Resource URL
This is the code i am trying to run :
search(){
return this.http.get('http://api.sandbox.amadeus.com/v1.2/flights/low-fare-search?origin=IST&destination=BOS&departure_date=2018-10-15&return_date=2018-10-21&number_of_results=3&apikey=my API key')
.subscribe((data) =>{
console.log(data)},
(err) => {console.log(err)});
Here is the error message
errorcode: "messaging.adaptors.http.flow.ApplicationNotFound"
faultstring:"Unable to identify proxy for host: default and url:
/v1.2/flights/low-fare-search"
Can someone explain to me in simple terms what could be causing this error?

In your example, you are using http instead of https
I tested your example and it works for me:
https://api.sandbox.amadeus.com/v1.2/flights/low-fare-search?origin=IST&destination=BOS&departure_date=2018-10-15&return_date=2018-10-21&number_of_results=3&apikey={your_api_key}

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.

Express JS changing line break type to CRLF

I am trying to make a HTTP request from a Flutter App to a Express-JS Server running on an Ubuntu machine. A newer version of Flutter(v1.22.5) throws following error when making the Request:
E/flutter (29477): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Invalid response, unexpected 10 in reason phrase
The code for making the request looks like this:
final response = await http.get(
'http://XX.XX.XXX.XXX/employees', //Hiding IP address for privacy purposes
headers: {
"Content-Type": "application/json",
"Authorization": api_key,
},
);
print(response.statusCode);
I can confirm by using HTTP-Tester Insomnia that the queried URL does indeed return information.
The issue seems to be known and can be viewed here
According to the Github-Thread, the issue is due to wrong line break format in the headers.
How can I tell Express JS to use CRLF?
For anyone stumbling across this question, I fixed it by reconfiguring my API-Server. Closer inspection of this problem lead to the conclusion that neither the App nor the API was bad, due to the fact no API-Request did actually reach my API-Code. I figured it out by simply looking at the logs. In my case, it was NginX not working properly as a reverse-proxy. I followed this tutorial to properly set it put.

How to bypass the Sails body parser for multi-part form uploads

I am facing a problem on Sails.js (0.9.16) with POST requests sent from a JAVA client.
On the client side I built a POST request (with enctype : multipart/form-data) sending a text file.
On the server side, I created a controller with a method (action) getRequest which looks like :
getRequest: function (req, res, next) {
//var busboy = require('connect-busboy');
console.log('req: ', req);
return res.send(200);
}
But I have the following error on my sails.js console:
Error: 'Unable to parse HTTP body :: { [error: Expected CR Received 10] status: 400 }
So I saw on the Web that Express/Connect included with Sails.js was not appropriate to handle multipart data, has anybody already faced my problem and succeed to use an other middleware like busboy or formidable to handle these kind of request?
Thanks in advance.
Best
Loïc
I've been trying to solve this problem as well. Looks like skipper from the sails team is the way to go. https://github.com/balderdashy/skipper
The docs appear to be decent w/ examples for sails 0.10.0 & 0.9.x.
See this thread on GitHub https://github.com/balderdashy/sails/issues/1521 for more info and background.
Hope this helps. FYI - The google group for sails is active.
Graham

Can't POST data to Shopify using Proxy

I'm attempting to POST data to a shopify store via a proxy page. I have been able to GET data via the URL on a proxy page but I have been getting the same error over and over again when attempting to POST data.
The error is:
{
"errors": {
"fulfillment": "Required parameter missing or invalid"
}
}
However the API states that I can POST data to a URL like the one below (I've masked the URL a bit to protect security Info) http://docs.shopify.com/api/fulfillment#create
https://XXXXXXX:XXXXXXX#XXXXXXX.myshopify.com/admin/orders/238974545/fulfillments.json
The data that I am attempting to post is:
{
"fulfillment":{"tracking_number":"9405510200881104822769","notify_customer":
false}}
Has anyone experienced this? If so how have you overcome this?
I was getting this same error. Here: https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/fulfill-by-api-190660#comment-190683 shopify support recommended that you specify the header Content-type as application/json in your http request. I did this and it fixed the problem.

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

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.