// Set the ID of the creative template to get.
Long creativeTemplateId = Long.parseLong("INSERT_CREATIVE_TEMPLATE_ID_HERE");
// Get the creative template.
CreativeTemplate creativeTemplate =
creativeTemplateService.getCreativeTemplate(creativeTemplateId);
if (creativeTemplate != null) {
System.out.println("Creative template with ID \"" + creativeTemplate.getId()
+ "\", name \"" + creativeTemplate.getName()
+ "\", and type \"" + creativeTemplate.getType() + "\" was found.");
for (CreativeTemplateVariable variable : creativeTemplate.getVariables()) {
System.out.println("Variable with name \"" + variable.getUniqueName() + "\" is "
+ (variable.getIsRequired() ? "required." : "optional."));
}
} else {
System.out.println("No creative template found for this ID.");