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;