How to open an API URL in Swagger - api

I have a URL say (https://example.net/api) and I need to see the endpoints associated with this URL in Swagger to perform API calls.
I tried options like (https://example.net/api/swagger.json) and (https://example.net/api/swagger.yaml) in Swagger Hub and Inspector as well but no luck. Instead I'm getting request terminated error.
Can anyone help me out with this.
Thanks!

Related

Requestly chrome extension mock api response to 503

I want to change HTTP Status Code to 503 with a custom response body on URL ending with .mpd. I am using Requestly chrome extension to intercept the request and have it failed with 503.
Here is the Modify API Response rule screenshot
Here's Requestly logs in devtools which shows that request was correctly intercepted.
The rule looks like it kicks in but is not showing the correct response code. Looking at the network tab it looks like the interception did not work
Need help with mocking the status code to 503 and custom response body.
HTTP Status Code can not be changed by Chrome Extension. Chrome doesn't provide any APIs which allow Chrome Extensions to change the status code.
You should be able to solve this problem using the Requestly desktop app where you can also specify the status code while defining your mocked API response.
A desktop app-based solution is more reliable however if you really want to work with Chrome extension only. Here's a workaround that you can try
Setup a new API Mock with 503 Status Code and the Response Body
Setup a new Redirect Rule to redirect your actual URL to the Mock URL
More details are covered in this SO answer
References
https://requestly.medium.com/simulate-different-api-status-code-using-requestly-76f917c445eb

Flowgear endpoint not working

Trying to test a sample endpoint for a workflow that I configured as follows:
POST https://mycompany.flowgear.net/bizrules/validation/gstCheck/?name={businessName}&number={businessNumber}&date={startDate}&canID={candidateID}&pID={placementID}
I tested that endpoint on a browser with this, but it gives me a JSON with "There is no service at this location":
https://mycompany.flowgear.net/bizrules/validation/gstCheck/?name=ZV Consulting Inc.&number=83848 5183&date=09/02/2014&canID=309731&pID=3835
What am I doing wrong?
You're binding to POST so you can't open the URL in a browser as your browser is performing a GET. To test you'd need to use the Postman plugin and set the method to POST.
One thing to note though is that Postman makes cross origin requests so you need to set Allowed Origins to * in your Flowgear site detail screen (same place you set your vanity domain).

No Images Over SSL in Ebay Finding API?

I have recently moved from HTTP to HTTPS but I'm getting security warnings because the pictures from ebay API are still transferring over HTTP. Does any API user know of a way to get gallery url or picture url over HTTPS?
I have tried making a call through HTTPS like this https://open.api.ebay.com/xxxxx but obviously it won't work. Is there a parameter option for returning HTTPS link?
A returned data in a successful call from GetSingleItem API is like this:
<GalleryURL>
http://thumbs1.ebaystatic.com/pict/xxxxx.jpg
</GalleryURL>
<PictureURL>
http://i.ebayimg.com/00/s/ODUwWDgwMA==/z/xxxx.JPG?set_id=xxxx
</PictureURL>
I have had the same issue, I used galleryURL property of SearchItem object returned by ebay Finding API, but found that even galleryURL provides insecure link to image, the same image available on if I replace http with https.

Error: redirect_uri_mismatch

I've been looking for this answer and the other pages didn't help me.
I'm trying to use the google drive api for php. I am trying to test on my local environment and receive this error.
Error: redirect_uri_mismatch
The redirect URI in the request: urn:ietf:wg:oauth:2.0:oob did not match a registered redirect URI
Request Details
scope=https://www.googleapis.com/auth/drive
response_type=code
redirect_uri=urn:ietf:wg:oauth:2.0:oob
access_type=offline
display=page
prompt=consent
client_id=735129338633-0epug8n80jsg0t50ijn7our4a661nnk6.apps.googleusercontent.com
Here is the page for the api:
The url is in
localhost:8888/Spreadsheets/driver.php
What am I doing wrong?
Looks like the current Google OAuth2 integration requires enabling
Contacts API
Google+ API
from the Google Developers Console for the associated Project. In my log I noticed errors liek 403, Access Not Configured. Please use ....
The redirect URI (where the response is returned to) has to be correct and exactly as you registered in the APIs console, and the error is indicating that you haven't done that or you haven't done it correctly.
To get the redirect URI from console:
Go to the console for your project and look under API Access.
Open Credentials section (in left side)
You should see your client ID & secret there, along with there is a
list of redirect URIs. If you want to change it or it was wrong,
click edit settings and modify.
Even if your redirect uri is properly set in the console, a lot of times, when you've recently changed settings in the google dev console, it will still tell you there's a redirect mismatch. It's a surprisingly common occurrence.
You can try...
Waiting; some have had luck with this, indicating that google takes some amount of time to register recent changes.
If you don't mind reconfiguring your app, creating a new client id in the google dev console tends to fix this problem with consistent results.

google weather api links need human authentication

I developed a weather app using google weather API
but from today it stopped working.
When I tried to access the weather API using location through browser it asks for human authentication.
How can my app work when it is like this? Is there a way to bypass the authentication process?
It's very odd behavior...I wonder if it has something to do with headers that are passed along as when I try loading the API url in Chrome, Unsupported API...or if I do same URL in Firefox, works just fine.
It's also worth noting that I tried setting up an Apache Proxy to Google's weather service by placing the following two lines in a separate Web Server's apache config and referenced the API via www.domain.com/weather/api?weather=Chicago and it still works...so that's my workaround for now:
ProxyPassReverse /weather/ http://www.google.com/ig/
ProxyPass /weather/ http://www.google.com/ig/
Try to change domain, ex: http://www.google.ca/ig/api?weather=Sondrio . It works (for now :D).
Looks like it is out of use from now on
Even using .CA it returns Unsupported API randomly.
Pity
Yeah, interesting, Google seems to send back random "Unsupported API" responses if the request is missing the cookies that the browsers (tested with Chrome and Firefox) are including with requests to the inofficial weather URL.
I've fixed my application by copying the entire "Cookie:" header I found when I ran the request in Firefox with Firebug's "Net" tab enabled.
Not sure where on .google.com the browser got the cookies from yet, I presume from using a personalized service like gmail.
if you are looking for a weather API that works right now, I have a suggestion…
Try Metwit Weather API, it's new but sounds very cool…
This api is really simple to use because it use standards that are available nowadays, like JSON and REST.
you can use this new api this has the same xml structure of google weather api
http://en.previmeteo.com/professionals/google-weather-api.php