Get a template's XML from the public template library
Answers one library template's XML - the file the console's template Import takes - without installing it, so it can be handed to someone or imported elsewhere.
Reference
GET https://YOUR-NETWORK-DOMAIN/rest-api/template-catalog/xml.do
Answers one library template's XML - the file the console's template Import takes - without installing it, so it can be handed to someone or imported elsewhere. The copy is checked against the library's catalog first. Requires the Templates create permission and the Templates view permission on all templates (the library reports what the whole network holds).
Query Params
entryIdstringrequired
The library template's id, as the library list gives it
catfish/catfish/mobile-catfish
Responses
200
success true, entryId, name, uniqueId, buildVersion, placementType, templateType and xml (the template XML as text)
400
Bad request — invalid or missing parameters
401
Authentication error
403
No Templates create permission, or Templates view is not granted on all templates
404
No such template in the library
503
The template library is not set up on this network, could not be read, or its copy does not match its catalog
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("GET"), "https://YOUR-NETWORK-DOMAIN/rest-api/template-catalog/xml.do?entryId=catfish%2Fcatfish%2Fmobile-catfish");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());