CloudConvert API

CloudConvert API

I have searched around to convert an image to a PDF but was unable to find anything. I came across CloudConvert which has 25 free credits per day for file conversions.

A few topics, such as this were looking for file conversions. One of the replies says that they found CloudConvert's API, but were having problems to get it working in Deluge.


I have attached a sample script to give you a general idea:


  1. rec = Writer_Test[ID == rec_id];
  2. header_map = Map();
  3. header_map.put("Authorization","Bearer API_KEY");
  4. header_map.put("Content-type","application/json");
  5. import_pram_map = Map();
  6. import_pram_map.put("url","https://creatorapp.zohopublic.com/file/owner/app/report/" + rec_id + "/File_upload/download/public_key?filepath=/" + rec.File_upload);
  7. // //import
  8. import = invokeurl
  9. [
  10. url :"https://api.cloudconvert.com/v2/import/url"
  11. type :POST
  12. parameters:import_pram_map
  13. headers:header_map
  14. ];
  15. import_task_id = import.get("data").get("id");
  16. //wait for import
  17. import_task_sync = invokeurl
  18. [
  19. url :"https://sync.api.cloudconvert.com/v2/tasks/" + import_task_id
  20. type :GET
  21. headers:header_map
  22. ];
  23. import_task_sync_id = import_task_sync.get("data").get("id");
  24. //convert
  25. convert_pram_map = Map();
  26. convert_pram_map.put("input",import_task_sync_id);
  27. convert_pram_map.put("output_format","pdf");
  28. convert_pram_map.put("filename", "file_name.pdf");
  29. convert = invokeurl
  30. [
  31. url :"https://api.cloudconvert.com/v2/convert"
  32. type :POST
  33. parameters:convert_pram_map
  34. headers:header_map
  35. ];
  36. convert_task_id = convert.get("data").get("id");
  37. // //wait for conversion
  38. convert_task_sync = invokeurl
  39. [
  40. url :"https://sync.api.cloudconvert.com/v2/tasks/" + convert_task_id
  41. type :GET
  42. headers:header_map
  43. ];
  44. convert_task_sync_id = convert_task_sync.get("data").get("id");
  45. //export
  46. export_pram_map = Map();
  47. export_pram_map.put("input",convert_task_sync_id);
  48. export = invokeurl
  49. [
  50. url :"https://api.cloudconvert.com/v2/export/url"
  51. type :POST
  52. parameters:export_pram_map
  53. headers:header_map
  54. ];
  55. export_task_id = export.get("data").get("id");
  56. //wait for export
  57. export_task_sync = invokeurl
  58. [
  59. url :"https://sync.api.cloudconvert.com/v2/tasks/" + export_task_id
  60. type :GET
  61. headers:header_map
  62. ];
  63. pdf_link = export_task_sync.get("data").get("result").get("files").getJSON("url");
  64. return pdf_link;

API_KEY is obtained from CloudConvert's API Key Website. You have to sign up/log in to create an API Key.

For the image URL, I have passed an image that is stored inside Creator. I am using the public link of that image.



My use case here was to create a PDF which consists of the main PDF file attached with an image at the end. Both the image and the PDF are stored in Creator. Once the files are uploaded and submitted in Creator, the image is converted to a PDF, after which I am using the Combine PDF API of Writer to get the image attached to the PDF. After that it is uploaded to Writer through its API.

One conversion consumes one credit. From what I have seen, uploading and downloading from CloudConvert consumes no credits.


Links for reference:



https://cloudconvert.com/api/v2/export#export-url-tasks

https://cloudconvert.com/api/v2/jobs#jobs-wait


I think the whole thing is also possible through their Jobs API, so you do not have to use so many invokeurl tasks. I'll try getting it to work with that.

    Zoho Developer Community






                              Zoho Desk Resources

                              • Desk Community Learning Series


                              • Digest


                              • Functions


                              • Meetups


                              • Kbase


                              • Resources


                              • Glossary


                              • Desk Marketplace


                              • MVP Corner


                              • Word of the Day



                                  Zoho Marketing Automation
                                          • Sticky Posts

                                          • Merge and Store v1 API depreciation

                                            Hi Zoho Writer users, The Merge and Store v1 API allows you to store the merged document in Zoho WorkDrive. The response of this API will be returned with the document's ID only after the merge is complete. In Deluge, the maximum timeout for operation
                                          • Zoho Creator Developer's Conference 2017 !!!

                                            We welcome all our Creator Developers! You're invited to join us for our annual Zoholics Developers conference August 29th–31st! This is your chance to get training and guidance on Zoho Creator from our most knowledgeable custom app builders.       Zoholics Developers is a three-day event where you'll participate in interactive workshops to hone your app-building skills, get questions answered by Creator experts with personal one-on-one sessions, and connect with other Creator developers from around
                                          • Share your success story

                                            We would like to hear from our passionate users how much Zoho Creator has changed the way you work and benefited you. If you would like to share your story to us and be featured as a proud user of Zoho Creator, then this is for you. Fill up the form below and if you want to be included in a case study, we will get in touch with you to get further details. So what are you waiting for? Tell us your story. Charles


                                          Manage your brands on social media



                                                Zoho TeamInbox Resources

                                                  Zoho DataPrep Resources



                                                    Zoho CRM Plus Resources

                                                      Zoho Books Resources


                                                        Zoho Subscriptions Resources

                                                          Zoho Projects Resources


                                                            Zoho Sprints Resources


                                                              Qntrl Resources


                                                                Zoho Creator Resources


                                                                  Zoho WorkDrive Resources



                                                                    Zoho Campaigns Resources

                                                                      Zoho CRM Resources

                                                                      • CRM Community Learning Series

                                                                        CRM Community Learning Series


                                                                      • Tips

                                                                        Tips

                                                                      • Functions

                                                                        Functions

                                                                      • Meetups

                                                                        Meetups

                                                                      • Kbase

                                                                        Kbase

                                                                      • Resources

                                                                        Resources

                                                                      • Digest

                                                                        Digest

                                                                      • CRM Marketplace

                                                                        CRM Marketplace

                                                                      • MVP Corner

                                                                        MVP Corner

                                                                      





                                                                      




                                                                          Design. Discuss. Deliver.

                                                                          Create visually engaging stories with Zoho Show.

                                                                          Get Started Now