This post is for individuals who are trying to connect to API2PDF via code. Depending on how you are connecting to API2PDF, or any service that is behind Cloudflare really, you might find that you are getting an error like so:
Access denied | v2018.api2pdf.com used Cloudflare to restrict access. The owner of this website (v2018.api2pdf.com) has banned your access based on your browser’s signature.
API2PDF uses Cloudflare for basic security protection, and it is very likely blocking your API calls if you are not using a recognized user-agent string.
We have found that setting your user agent to:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Will resolve the issue.
Tags: access denied cloudflare, api2pdf issue, user agent