Can't get any response from hapi-swagger on windows server - swagger

I have a code that use hapi-swagger for my API Documentation, and i put that code into windows server, but i can't get any response when i hit my endpoint. I don't know why, cause when i pull my code and try on localhost everything is fine.
This is my hapi-swagger response, and it should be like this
Can someone help me for this? It would make my day, thanks!

Related

Trying to connect odata Source to tableau - trying to trouble shoot error

I am hoping someone might be able to help me with this,
I unable to connect https://services.odata.org/V4/Northwind/Northwind.svc/
however, it comes to using our endpoint, which is $metadata
I get an error message 'Bad Odata format make sure you are using a URL that points to a valid OData source
Also, I can open this URL in my web browser
I can't seem to troubleshoot, this can anyone suggest anything I can try?
I have also tried changing the IP to a name, but still same error.
Your OData server returns XML data instead of JSON.
Change your configuration in JSON format it will work.

Why am I receiving a 500 status when trying to connect with ASANA api?

I am using this example: https://github.com/ajimix/asana-api-php-class/blob/master/examples/oauth.php to learn how to use the asana's oauth. I already registered my app on the asana's developers webpage. But, when I get the asana's response with my 'redirect_url'?code=0%XXXXXXX, localhost gives me a 500 status. I don't know why, does anyone know how I can solve it?
I tried using the other examples in there: https://github.com/ajimix/asana-api-php-class/blob/master/examples/, but I wasn't able to make them run either, I always get a 500 status. I think that the problem must be in my server, but I don't how solve it. Maybe changing something on the .htaccess file, but I don't really know what to put in there.
If you're looking to use the Asana API from PHP may I recommend the official first-party client: https://github.com/Asana/php-asana
It also contains examples of how to use with OAuth and is officially supported by us at Asana :-)

synapse httpsend through proxy server

I have a routine that currently uses
httpgettext to send two urls out to google..
The first with the maps key
and the second to get some distance calculations with is returned as a JSON object...
It all worked fine but now the client wants it to go through a proxy server.
I have tried modifying code that was on synapse knowledge base but i just get a bad response...
The code looks like this that works no proxy...
buildstring:='http://maps.google.com/maps?file=api&v2&key=ASASASASASASASAS-AAAA';
httpgettext(buildstring,myoutput);
buildstring:='http://maps.googleapis.com/maps/api/directions/json?origin='+trim(start_postcode)+'&destination='+trim(end_postcode)+'&sensor=false';
httpgettext(buildstring,myoutput);
How do I get the same response but through a proxy?
The google maps key above is fake - and will not work - you need to use your own.
When I tried modifying an example the first request came back OK the second one came back with a 400 bad request.
With thanks in advance
Phil Hutchinson
I have found the issue?
I looked at the source code demos supplied and if I create a type of httpsend and put the proxy info in and send the request, the first one works.
The second request fails - so it must be something to do with the htppsend method leaving some rubbish in the type. If I destroy it and send it again it works fine.
Not the perfect solution but it works!

curl post testing oauth 2.0 not working while the http example does

I am trying to understand how Google authentication works with OAuth 2.0. They give some examples at this link.
I am having trouble with one of the first steps. I can execute this http request in a browser:
https://accounts.google.com/o/oauth2/auth?scope=https://www.google.com/m8/feeds&client_id=21302922996.apps.googleusercontent.com&redirect_uri=https://www.example.com/back&response_type=token
and that works fine.
When I try to convert it to a curl GET operation,
curl https://accounts.google.com/o/oauth2/auth?scope=https://www.google.com/m8/feeds&client_id=21302922996.apps.googleusercontent.com&redirect_uri=https://www.example.com/back&response_type=token
I get a response that tells me there is an OAuth 2.0 error: invalid_request.
Converting it to a POST, I can't get this operation to work.
curl http://accounts.google.com/o/oauth2/auth -d “scope=https://www.google.com/m8/feeds&client_id=21302922996.apps.googleusercontent.com&redirect_uri=https://www.example.com/back&response_type=token”
The response is that the document has moved.
If I try this, I get similar results.
curl http://accounts.google.com/o/oauth2/auth -data-urlencode “scope=https://www.google.com/m8/feeds&client_id=21302922996.apps.googleusercontent.com&redirect_uri=https://www.example.com/back&response_type=token”
I have never used curl or OAuth in my code before, so I want to understand some of these basics. Can someone tell me what is wrong with my GET and POST ?
I don't have a sure answer for you, but I was working on something similar for Instagram and one thing that stumped me for a while was that my redirect URL looked to be the same as Instagram expected, but I kept getting errors.
Like you, when I 'hand coded' the redirect URL, I got the result I expected, but my automated calls to the authentication URL failed. It turned out my ampersands were a url encoded which Instagram compared to the redirect URL and saw they were not identical. I'm not sure if that will get you closer to an answer, but I thought I'd share my experience since your question reminds me of the situation I was in. Good luck.

Twitter api statuses/destroy api 401 error

I'm authenticating with OAuth getting my request token, authorizing, doing POST to get the AccessToken and then pulling my user_timeline.xml
At this point I try and call the destroy api on a particular status id and it returns a 401 unauthorized.
I am able to take the url and the parameters out and call this through Fiddler2 and it works, but using it in a Delphi app with Indy V10 component, doing a POST it's giving this 401 still.
What can I be missing?
Thanks,
david
If I can figure this out this app is good to go, very frustrating.
Please help!
Figured it out. Finally ran a .NET version of code, ran Fiddler2 to see what it did and noticed the Authorization Header. I then had to find a reference to this in regards to the Indy Components to figure it out. You have to add CustomHeaders with a specific format.
You may wanna try my implementation with ICS, supports Unicode as well
http://eden.fm/2011/02/27/twitter-library-for-delphi/

Resources