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

Browser URL Syntax

kaywic wrote on 2019-01-23:
I am using a block based application builder, and I would like the syntax for using HTML-PDF, via POST but through a browser URL, and not using curl.

I can not see any syntax examples for it, or documentation.

Example I want to do a post something like, to https://pdfcrowd.com/convert&username=xxxxxxxx&api-key=8383838383&file=/path/to/file&pdf-params1=xmxm

Can you give me some pointers
support wrote on 2019-01-24:
Please try our examples project on Github:
-- https://github.com/pdfcrowd/pdfcrowd-examples/tree/master/ajax
kaywic wrote on 2019-01-24:
I do not see any URL options there. Only Javascript. Are there any other URL options?
kaywic wrote on 2019-01-25:
In addition I tried the AJAX, and I was only able to get it working twice.

Each time my credit count would go down, but I would not receive the PDF.

So out of the 13 attempts, only two resulted in a download. That is from the AJAX solution presented above.

Please advise.
support wrote on 2019-01-25:
Hello,

Parameters for conversion API should be passed in a request body as mutipart or urlencoded.

Here is the list of all HTTP POST options:
-- https://pdfcrowd.com/api/html-to-pdf-http/#reference

Please send your JS code using Pdfcrowd API to support@pdfcrowd.com
kaywic wrote on 2019-01-28:
Can you give me an HTTPS request example of sending a URL for PDF . conversion. I just need the syntax please of apikey, url, pdf etc as a POST request.


I cannot find the example.
support wrote on 2019-01-29:
Hi,

Here is POST example via curl:
-- https://pdfcrowd.com/api/html-to-pdf-http/#examples

If you want to send a POST to our API from a browser, javascript is needed because the API uses basic auth:
-- https://github.com/pdfcrowd/pdfcrowd-examples/tree/master/ajax

It is not possible to specify a conversion as an URL because the API authentication must be sent in the HTTP headers and conversion parameters are encoded in the POST request body.