Why the watermark is present when "sandbox" is set to false?

The watermark is present on two reasons :

  1. When the sandbox parameter is set to True

  2. When you are not authenticated

The watermark is only enforced in a unauthenticated account. Free users can have 50 conversions without watermark and without having to upgrade to a plaid plan.

This article explains how to be able to convert without the watermark

Now, PDFShift identifies you via the Basic authentication method, and if it can't find the appropriate headers, your request will fallback to the unauthenticated mode, adding the watermark.

One way to be sure you are sending the proper authentication header is to try to load your credits. Only an authenticated user can retrieve their usage.

To do so, simply replace the call to the API with a GET request to https://api.pdfshift.io/v3/credits/usage.

If you are sending the appropriate authentication headers, you will get a JSON response containing your usage and total of available credits.

Otherwise, you will get a 401 or 403 error depending on how you sent the API key.

Depending on your programming language, you can either pass your API key when calling our servers using the user/password tuple, like in python:

response = requests.post('https://api.pdfshift.io/v3/convert/pdf', auth=('api', 'YOUR_API_KEY'), json={'source': '...'})

In some other languages, you can combine the username/password and encode them in base64, then pass them via the "Authorization" header:

Authorization: Basic base64_encode('api:YOUR_API_KEY')

That is basically what the requests package does in Python.

Was this helpful?