Hi,
Our domain name recently changed and unfortunately we cannot create a 301 redirect to our new domain.
This results in us having to update our domain name references in our ~500 Zoho Desk articles and ticket answers.
Since doing a bulk search and replace is not an option in Zoho Desk and updating 500 articles by hand would be very tedious, I'm trying to use the Zoho Desk API to:
1. Retreive the articles (done!)
2. Update the articles (done!)
3. Update the articles using the 'Update an article' function of the Zoho Desk API.
I wrote the following code:
// Consts
orgId = "20065186XXX";
articleId = "17121000023114XXX"; // ArticleId for testing purposes
// Headers
headerMap = Map();
headerMap.put("Content-Type","application/json");
// Parameters
paramMap = Map();
paramMap.put("title","Hello");
paramMap.put("answer","World");
info paramMap;
// Request URL
requestUrl = "https://desk.zoho.eu/api/v1/articles/" + articleId + "?orgId=" + orgId;
// Update Article
updateArticle = invokeurl
[
url :requestUrl
type :PATCH
headers :headerMap
parameters :paramMap
connection :"deskarticles"
];
return updateArticle;
To me, it would seem that this code should work. However, when I try to run this I'm receiving the following error:
{"errorCode":"UNSUPPORTED_MEDIA_TYPE","message":"The given content type is not supported. Please provide the input Content-Type as application/json"}
Some help in how to fix this would be very much appreciated.