Merge Contacts API Error

Merge Contacts API Error

I want to use the Zoho Desk API to merge duplicated contacts. I wrote the following Deluge function to do this:
  1. merge_contacts_api_payloads = List();
    merge_contacts_api_payloads.insert({'ids':{'842454000000989001','842454000002232455'},'source':{'firstName':'842454000000989001','lastName':'842454000000989001','email':'842454000000989001','secondaryEmail':'842454000000989001','accountId':'842454000000989001','twitter':'842454000000989001','facebook':'842454000000989001','phone':'842454000000989001','mobile':'842454000000989001','type':'842454000000989001','title':'842454000000989001','street':'842454000000989001','city':'842454000000989001','state':'842454000000989001','zip':'842454000000989001','country':'842454000000989001','description':'842454000000989001'}});
    newLine = hexToText("0A");
    for each  payload in merge_contacts_api_payloads
    {
        source_id = payload.get("ids").get(0);
        info "source_id = " + source_id;
        info newLine;
        request_url = "https://desk.zoho.com/api/v1/contacts/" + source_id + "/merge";
        info "request_url = " + request_url;
        info newLine;
        info "payload = " + payload;
        info newLine;
        response = invokeurl
        [
            url :request_url
            type :POST
            parameters:payload.toString()
            connection:"taskmaker"
        ];
        info "response = " + response;
        info newLine;
    }
I get the following error message in response:
  1. {"errorCode":"INVALID_DATA","message":"The data is invalid due to validation restrictions","errors":[{"fieldName":"/ids","errorType":"invalid","errorMessage":""}]}
I have verified that the contact IDs are correct. What do I need to do to make this work?

    Access your files securely from anywhere

        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


                                              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 Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • 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