This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Multiple API calls

raceoffice wrote on 2012-12-31:
Hi,

I am still quite happy with your service!

After using it now several month, I received the first time the exception "Multiple API calls not allowed".

I guess the limit is one call at time and I understand why you limit the number of calls. Obviously I would like to suggest to raise the limit to e.g. 3-5 calls. I do not expect many parallel calls, but 2-3 calls are realistic.

Independent of raising the limit, I would like to suggest to include some kind of IPS like Semaphores etc. to avoid this error already in the library. I have written my own wrapper now, but having it in the official library (mayby as optional parameter) would be great!

PS: I am using the PHP lib.

Best,
Guido
support wrote on 2013-01-02:
Hi Guido,

thanks for the feedback and suggestions.
If you want to avoid the 503 error it is perfectly ok to sleep() for a few seconds and then resend the failed request again:
$tries = 0;
$success = false;
    
while (!$success) {
    $tries += 1;
    try {
        $pdf = $client->convertURI("http://yourdomain.com");
        // ..
        $success = true;
    } catch(PdfcrowdException $why) {
        if ($why->getCode() != 503 || $tries == 5) {
            // log error and re-throw the exception
            throw $why;
        } else {
            sleep(2);
        }
    }
}
ryanmitchell wrote on 2013-04-16:
Is there any plans to remove this limitation, even as a paid upgrade option?

We are about to launch a service with the ability for users to generate PDFs on demand, so its likely that this issue will crop up. We could delay and email, but its not a good user experience.

PS - love the service, we've been using it for years now and have very few complaints!
support wrote on 2013-04-17:
We offer an unlimited package which lifts this limit, among other things. Contact us via email (info@pdfcrowd.com) for more details.