Gitbook API returning HTTP code 429 - https

I wrote a Gitbook API Android application in Java. However, I'm having a problem
when I use the API to access pubic book data with an HTTPS request from my Android device: the API returns HTTPS response code 429. How can I solve this issue?

Related

API server block request from GuzzleHttp

I have 2 servers which are API server and Client server ....
Both server using Google Cloud server and I use Laravel framework to develop my system...
So, currently the problem is, it return 403 error when calling API (to API server) using GuzzleHttp (from Client Server).....
But after I change the user agent to curl/7.65.3, suddenly it is working fine...
But I want to know why??? Is there any other solution without changing the user-agent???
Thanks
What is your use method? If GET you can refer to:
GET Requests That Include a Body
If a viewer GET request includes a body, CloudFront returns an HTTP status code 403 (Forbidden) to the viewer.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html

WSO2 API console requested an insecure XMLHttpRequest endpoint

Am using WSO2 API Manager 1.9.1 and have defined a service that can be access over both http and https. When I try to "test" it through the API Console under https://localhost:9443/store/apis/..., the API call fails as the REST AJAX call is send over http instead of https.
Chrome complains that the page was loaded over HTTPS but requested an insecure XMLHttpRequest. The request is blocked as it should be served over HTTPS.
Firefox likewise blocks the request with a "mixed active content" error.
Safari fails with a more obscure message: "Failed to load resource: The network connection was lost.".
A workaround is to set the API scheme to https only but this is not particularly desirable. Is there a fix or other way to cope with this issue?
This issue occurs when you're trying to access a HTTPS URL from the web browser
but the end point is actually HTTP. This is not the default behavior of swagger console in API manager 1.9.
Usually when you are accessing from the web browser using HTTPS, API console
(swagger console) calls an end point of HTTPS by default.
Try to expose the service as both HTTP and HTTPS(Manage Tab) when you are publishing an API.
Thanks
Ojith

AWS api gateway - http proxy should take status code from origin

I am currently trying to setup AWS Api Gateway, to proxy to another api, that has fully functional methods, response content, status codes etc. This is fairly simple to setup, but I have noticed that the Api Gateway always returns 200 OK no matter what the origin api responds with.
Fx. if there was a bad request (in the origin api) which results in a error message in JSON and a 400 Bad Request, the Api Gateway will respond with a the exact same error message, but a status code of 200 OK
If I remove all settings from the Message Response in the API Gateway web-interface, I get an internal error in the API Gateway. Can it be true that I have to map all the different status codes from the origin api manually in the Api Gateway?
I would prefer if it was possible to just let the status code (as well as the response, which currently works great) pass through, and not have the Api Gateway touch it in any way.
Proxy integration can be used to achieve this. In this case, it is HTTP Proxy. Lambda Proxy integration can also be used but will need some code logic in lambda. API GW will then return the result as-is.
You are correct that currently when using API Gateway you are required to map all response codes in your integration responses. We have heard this "pass through" request from other customers and we may consider including this in future updates to the service.

Django REST framework API only working from the API project

I am developing a REST API for my application with django-rest-framework.
Everything works fine as long as I use either:
The browsable API
AJAX requests within a template in the same project where the API is being built
If I try to access the API from oustide the "master" project (the one I am building an API for), for instance from another Django project on the same machine, I am constantly getting an error.
Here is the trace from runserver for a successful API call:
[21/Nov/2014 12:11:01] "GET /api/test_session/ HTTP/1.1" 200 9208
The same endpoint but from outside the master project (it fails):
[21/Nov/2014 12:11:14] "GET /api/test_session/ HTTP/1.1" 200 58
I am using the ajax function of jQuery to send my API calls and I have set up the error callback. However the errorThrown that I receive is empty and the textStatus property only says "error".
How do I access my API from the oustide? I am using the default authentification backend (session based).
After some discussion it came to light that the error had to do with Cross Origin Resource Sharing policies.
A solution tailored for Django is to use django-cors-header, as recommended by the django REST framework documentation.

What User-Agent to give my WebApi Requests?

I am using an api and I noticed that when I use RestSharp and do a call from my asp.net web api project my request fails.
I turned on fiddler and for whatever reason the api I am requesting thinks I am a mobile device and thus is redirecting me to the mobile site that does not support api calls.
I then did a request in fiddler and I can access the api. I changed my user-agent to fiddler through restsharp and now my requests go through when using my web api.
I don't want to leave it fiddler though. What should I use instead?
You are in-effect creating your own user-agent, so invent your own identifier. E.g. choboAgent/1.0

Resources