Need help with Merge and Store V2 API call

Need help with Merge and Store V2 API call

Hi Writer Team,

Thanks for a great product. I need help with this code. It fails and there is zero data in the response variable. I'm debugging blind.

I am 100% confidence that my workdrive_crm_folder_id and connection strings are correct, and the datamap fields match what is in my template.

  1. merge_template_id = "u5mlhff1eb939ff45464fab2076ad60dea955";
  2. datamap = map();
  3. datamap.put("Option", "Ms.Amelia");
  4. datamap.put("Product", "S");
  5. datamap.put("Code", "A");
  6. datamap.put("Item", "AnItem");
  7. datamap.put("Price", "Good");
  8. outputsettings = Map();
  9. outputsettings.put("doc_name","test");
  10. outputsettings.put("folder_id",workdrive_crm_folder_id);
  11. outputsettings.put("output_format","pdf");    
  12. outputsettings.put("overwrite_existing_file","true");     //<true/false>  //optional
  13. param = map();
  14. param.put("merge_data",{"data":datamap});
  15. param.put("output_settings",outputsettings);
  16. response = invokeurl
  17. [
  18. url: "https://www.zohoapis.com/writer/api/v2/documents/" + merge_template_id + "/merge/store"
  19. type: POST
  20. parameters: param
  21. connection:"mailmerge"
  22. ];
  23. info response;

Please help!

Thank you.