UNSUPPORTED_MEDIA_TYPE when using the end point /sendReply

UNSUPPORTED_MEDIA_TYPE when using the end point /sendReply

Hello there,

I am trying to do the following in a custom function:

1. render template
2. add information to template, which I can't configure directly in template (placeholders are not offered)
3. send template as ticket response

Unfortunately I always get the following message:

{
    "errorCode": "UNSUPPORTED_MEDIA_TYPE",
    "message": "The given content type is not supported. Please provide the input Content-Type
                as application/json"
}


Deluge example code:

ticket = invokeurl
[
    type :GET
    connection: "{name}"
];

template = invokeurl
[
    type :POST
    connection: "{name}"
];

surveyLinkElement = "{url}" + ticketId + "&a=" + agentId;
surveyLinkElement = '<a href="'+surveyLinkElement+'">Link</a>';
templateBody = template.get("body").replaceAll("[#surveyLink#]", surveyLinkElement, true);

params = Map();
params.put("content",templateBody);
params.put("contentType", "html");
params.put("fromEmailAddress", "{name}");
params.put("to", "{name}");
params.put("channel","EMAIL");

headerData = Map();
headerData.put("Content-Type", "application/json");

sendReply = invokeurl
[
    url :"https://support.zoho.eu/api/v1/tickets/" + ticketId + "/sendReply"
    type :POST
    parameters: params.toString()
    headers: headerData
    connection: "zohodesk"
];
info sendReply;

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly 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




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方