Coursera - Building first API Proxy 429 too many requests

I'm having an error using the training material and the provided openAPI specs. (Reverse proxy using the provided OpenAPI specs) Getting this error..

8761-coursera1.png

8762-coursera2.png

Solved Solved
0 2 523
1 ACCEPTED SOLUTION

You are getting "Too Many Requests" because you configured the Target of that API Proxy to the API Proxy itself. In other words, it's an infinite loop.

Your target looks like this:

<TargetEndpoint name="default">
    <Description/>
    <FaultRules/>
    <PreFlow name="PreFlow">
        <Request/>
        <Response/>
    </PreFlow>
    <PostFlow name="PostFlow">
        <Request/>
        <Response/>
    </PostFlow>
    <Flows/>
    <HTTPTargetConnection>
        <Properties/>
        <URL>https://topuzchn-eval-test.apigee.net/v1</URL> <<< WRONG HERE
    </HTTPTargetConnection>
</TargetEndpoint>

and https://topuzchn-eval-test.apigee.net/v1 is the INBOUND endpoint of the proxy.

So if you use postman to send a request to https://topuzchn-eval-test.apigee.net/v1/products/foo then it results in a never ending loop of requests. The proxy calls itself, forever and ever, until the proxy surrenders with a 429.

I am not familiar with the Coursera content you are using, but.. for sure the target URL should not be the same as the inbound URL. That's not gonna work. Double check the coursera notes to see the correct target URL.

View solution in original post

2 REPLIES 2

You are getting "Too Many Requests" because you configured the Target of that API Proxy to the API Proxy itself. In other words, it's an infinite loop.

Your target looks like this:

<TargetEndpoint name="default">
    <Description/>
    <FaultRules/>
    <PreFlow name="PreFlow">
        <Request/>
        <Response/>
    </PreFlow>
    <PostFlow name="PostFlow">
        <Request/>
        <Response/>
    </PostFlow>
    <Flows/>
    <HTTPTargetConnection>
        <Properties/>
        <URL>https://topuzchn-eval-test.apigee.net/v1</URL> <<< WRONG HERE
    </HTTPTargetConnection>
</TargetEndpoint>

and https://topuzchn-eval-test.apigee.net/v1 is the INBOUND endpoint of the proxy.

So if you use postman to send a request to https://topuzchn-eval-test.apigee.net/v1/products/foo then it results in a never ending loop of requests. The proxy calls itself, forever and ever, until the proxy surrenders with a 429.

I am not familiar with the Coursera content you are using, but.. for sure the target URL should not be the same as the inbound URL. That's not gonna work. Double check the coursera notes to see the correct target URL.

Thanks for your answer, my bad 🙂 u are totally right... It is like endless loop :))