In my app I have a template picker where users are able to select Confluence blueprints, space page templates and global page templates to create pages from. To generate the list of templates, I use the get blueprint templates and get content templates REST API. This works fine (apart from the fact that the blueprint API returns each blueprint twice and I’m not sure which one is the correct one).
To make the template picker more visually pleasing, I would like to show the blueprint icons that Confluence also shows. Unfortunately, I couldn’t find any icon URL in the JSON objects returned by the API.
The icons that Confluence shows are accessible under URLs such as https://*.atlassian.net/wiki/s/-/_/download/resources/com.atlassian.confluence.plugins.confluence-business-blueprints:90-day-plan-item/icon-v2
. The corresponding templates are these:
{
"templateId": "b601da24-df1a-471b-ba8c-cc45b9944c21",
"originalTemplate": {
"pluginKey": "com.atlassian.confluence.plugins.confluence-business-blueprints",
"moduleKey": "90-day-plan-page"
},
"referencingBlueprint": "com.atlassian.confluence.plugins.confluence-business-blueprints:90-day-plan-blueprint",
"name": "90-day plan",
"description": "90-day-plan.blueprint.content.template.description",
"labels": [],
"templateType": "blueprint",
"editorVersion": "v2",
"_expandable": {
"body": ""
},
"_links": {
"self": "https://cdauth.atlassian.net/wiki/rest/api/template/b601da24-df1a-471b-ba8c-cc45b9944c21"
}
},
{
"templateId": "0cbf128f-8f40-402d-b5aa-fa3a30285d8e",
"originalTemplate": {
"pluginKey": "com.atlassian.confluence.plugins.confluence-business-blueprints",
"moduleKey": "90-day-plan-index"
},
"referencingBlueprint": "com.atlassian.confluence.plugins.confluence-business-blueprints:90-day-plan-blueprint",
"name": "90-day plan",
"description": "",
"labels": [],
"templateType": "blueprint",
"editorVersion": "v2",
"_expandable": {
"body": ""
},
"_links": {
"self": "https://cdauth.atlassian.net/wiki/rest/api/template/0cbf128f-8f40-402d-b5aa-fa3a30285d8e"
}
}
As you can see, the icon is not referenced anywhere. I could guess it from the originalTemplate
property, but there is not one consistent pattern that applies to all blueprints.
Is there a proper way to get the blueprint icon?