Merge and Store V2 API

Merge and Store V2 API

Purpose: 

In Merge and Store V1 API, the response will be returned along with the RID only after the merge is completed. In Deluge Script, the maximum timeout will be 40 secs. In some cases, the merge operation will exceed 40 secs which fails the DRE workflow.  

To overcome this problem, we have introduced Merge and Store V2 API . In which, the response will be returned immediately along with a virtual RID and merge operation will be scheduled in the backend to store the merged document in the   virtual RID. User can use this virtual RID and proceed with their workflow. Until the scheduled merge operation is completed, the virtual RID will be provided with the temporary content.  

To track the merge status, you can either make use of the ‘merge_report_data_url’ or ‘merge_report_url’ generated in the response.  

The parameters and scopes are same as in Merge and Store V1 API . Inside the 'output_settings' parameter, we provide another one optional key (merge_to) for Merge and Store V2 API. 

Body Parameters
Parameter Data Type Description
Mandatory Parameters
output_settings

'doc_name': "<new document name>",

'folder_id': "<folder_id>" ,    

'output_format': "<pdfform/pdf/docx>",

'password': "<*****>",    

'overwrite_existing_file': "<true/false>",

'merge_to':"<separatedoc/singledoc>

}

 

Pass the values for 'doc_name' and 'folder_id' via this parameter as JSON.


doc_name -> Specify the name for the merged document.


folder_id -> Specify the id of the folder in which you would like to store the merged document.


output_format (optional) -> Supported formats are pdf, pdfform and docx. Specify a format in which you would like to store the merged document.


If this key is not passed, the merged documents will get stored in Writer format (zdoc) by default.


password (optional) -> Specify a password if you would like to protect the merged document. This param is applicable only for pdf and docx documents.


overwrite_existing_file (optional) -> Use this param, if you wish to replace an existing file stored in Zoho WorkDrive with the merged document.


merge_to (optional) ->  Specify in which type you would like to merge the document.

separatedoc - If you would like to merge each record as a separate document.


singledoc- If you would like to merge all the records as a single document.


Note: By default, we will consider separatedoc merge type.

Apart from this, only the 'HTTP Request URL' and the 'Response Structure' changes.  We have shared the details below:

HTTP Request URL

https:// {zohoapis_domain} /writer/api/v2/documents/ {{document_id}} /merge/store

Sample Response: 

{
    "merge_report_data_url": "<url>",
    "merge_report_url": "<url>",
    "records": [
        {
            "data": [{“given input merge_data”}],
            "download_link": "<attachment download url>",
            "document_id": "<merged doc id>",
            "document_url": "<merged doc open url>",
            "status": "inprogress"
        }
    ],
    "status": "inprogress"
}

When you invoke the 'merge_report_data_url', you will receive the below response;

// If 'merge_to' = "separatedoc"
{
    "records": [
        {
            "download_link": “{url}“,
            "data": {
                            "name": “Amelia”,
                            “email”: “amelia@zylker.com
                        },
            "document_id": "ponazfea04477109f4681a831e7177d96bc40",
            "document_url": "http://writer.zoho.com/writer/open/ponazfea04477109f4681a831e7177d96bc40",
            "status": "inprogress"
        },
        {
            "download_link": “{url}“,
            "data": {
                            "name": “John”,
                             “email”: “john@zylker.com
                        },
            "document_id": "ponazfea04477109f4681a831e7177d96bc40",
            "document_url": "http://writer.zoho.com/writer/open/ponazfea04477109f4681a831e7177d96bc40",
            "status": "inprogress"
        }
      ],
    "status": "inprogress"
}

// If 'merge_to' = "singledoc"
{
    "records": [
        {
            "download_link": “{url}“,
            "data": [
                     {
                            “name": “Amelia”,
                            “email”: “amelia@zylker.com
                     },
                     {
                            “name": “John”,
                            “email”: “john@zylker.com
                    }
              ],
            "document_id": "ponazfea04477109f4681a831e7177d96bc40",
            "document_url": "http://writer.zoho.com/writer/open/ponazfea04477109f4681a831e7177d96bc40",
            "status": "inprogress"
        }
    ],
    "status": "inprogress"
}


Sample Snippet via Deluge:

document_id = "fbsa6360a78f53f564dfa9b4a1e79febed569";
fieldInfo =  invokeurl
[
type: GET
connection:"<connection_name>"
];
fieldsList =  fieldInfo.get("fields");
datamap = map();
for each field in fieldsList
{
 info field;
}
datamap.put("Name", "Ms.Amelia");
datamap.put("Tamil", "S");
datamap.put("English", "A");
datamap.put("Maths", "A");
datamap.put("Remark", "Good");
outputsettings = Map();
outputsettings.put("doc_name","Student Grade");
outputsettings.put("folder_id","bsa6360a78f53f***");    //Workdrive Folder ID  //optional
outputsettings.put("output_format","pdf");     //<docx/pdfform/pdf>  //optional
outputsettings.put("password","*****");    //optional
outputsettings.put("overwrite_existing_file","true");     //<true/false>  //optional
param = map();
param.put("merge_data",{"data":datamap});
param.put("output_settings",outputsettings);
response = invokeurl
[
type: POST
parameters: param
connection:"<connection_name>"
];




    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION









                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • Finish Merge

                                                                                                                Finish Actions Email Notifications You can enable email notifications to get notified when the merge is initiated and completed. You will receive an email as shown below, once the merge is initiated with a link to track the status of the merge ...
                                                                                                              • How to pass the data for the Merge field types via API/DRE?

                                                                                                                To know about the list of merge field types available, please refer this help link. How to pass the value for each merge field types via API? The value will be passed in a JSON format inside the 'merge_data' parameter. Sample JSON: { "data":[ { ...
                                                                                                              • How to setup post merge operations on Zoho CRM's mail merge

                                                                                                                How to attach merge document back to CRM record Execute any custom function after merge is complete with Zoho Writer. Functions that you write on your own are saved under My functions. Writer also has a set of pre-built functions with a few commonly ...
                                                                                                              • How to merge subform fields and image field with Zoho Writer's Merge APIs in Zoho CRM

                                                                                                                How to merge subform fields via Merge API's in Zoho Writer 1. Create a Merge template in Writer with related (RL) fields Sample Merge Template consisting of both Normal and RL fields: Hello <<Contacts.First Name>> Send a mail to <<Contacts.Email>> ...
                                                                                                              • How to use Zoho WorkDrive images into Writer merge fields?

                                                                                                                Zoho Writer only accepts Public URL for the image fields in Mail merge. If the images are stored in Zoho WorkDrive, you can create a downloadable link and use it as an input value for the image field. This can be done in the following three ways; a) ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources