I know the following question might be quite obvious to others, and be defined as a total newbie question and I appology for that on behalf, but the fact is I have never worked with cURL or webhooks, and I have been unable to find a way to use this in the technologies I use for the development (Classic ASP, jQuery, Bootstrap, IIS).
The issue is that I have to use PDFmonkey (since it can use Bootstrap HTML code)to generate a PDF from a JSON post from my site, but the only 2 ways that PDFMonkey provide me to do this is using RUBY or cURL and I do not know where to start so I need some help.
My questions are:
- How can I initiate the document generation in jQuery/Classic ASP with something similar to this:
curl 'https://api.pdfmonkey.io/api/v1/documents' \
-H 'Authorization: Bearer [API KEY]' \
-H 'Content-Type: application/json' \
-d '{
"document": {
"document_template_id": "[TEMPLATE ID]",
"payload": "{ \"name\": \"Jane Doe\" }",
"status": "pending"
}
}'
- .. then call for a status like this in cURL from jQuery/Classic ASP
curl 'https://api.pdfmonkey.io/api/v1/documents/d2f2de44-9de7-4dd8-90f4-bee5e99c9984' \
-H 'Authorization: Bearer [API KEY]'
- .. and finally receive the generated document information so I can display/save it in my site with something similar to:
curl https://your.website.com/replace-with-your-webhook \
-H 'Content-Type: application/json' \
-D- \
-d '{
"document": {
"id": "11111111-2222-3333-4444-555555555555",
"status": "success",
"app_id": "22222222-3333-4444-5555-666666666666",
"document_template_id": "33333333-4444-5555-6666-777777777777",
"payload": "{\"name\":\"Jane Doe\"}",
"checksum": "1234567890abcdefghijklmnopqrstuv",
"download_url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
"preview_url": null,
"meta": null,
"created_at": "2018-12-04T20:28:35.072+01:00",
"updated_at": "2018-12-04T20:28:38.899+01:00"
}
}'
I do not know where to start, and have been looking for boot jQuery and Classic ASP solution both here on StackOverflow and google generally, but have not found a solution for the technologies I use, and on a Windows IIS platform, but my initial thoughts would be that this can be achieved in jQuery somehow and this would be the best solution over using Classic ASP.