I spent two weeks putting a PDF processing API on RapidAPI. The code was the
easy part: twelve endpoints that already worked, serving a website. What cost
me the time was the gateway, and almost none of it is in the documentation.
1. The gateway routes only the endpoints you declare
My origin server has twelve endpoints. I defined four in RapidAPI's dashboard
to get the listing live, assuming the gateway was a dumb proxy that would
forward whatever path came through.
$ curl -X POST "https://...p.rapidapi.com/ocr-pdf" -H "X-RapidAPI-Key: $KEY " ... { "message" : "Endpoint '/ocr-pdf' does not exist" }
Enter fullscreen mode
Exit fullscreen mode
Eight of my twelve endpoints were unreachable. I had already written the
documentation for all twelve. Had I published it, every subscriber would have
hit a 404 on two thirds of the product.
Declare every endpoint before you write a line of docs.
2.…