Chilkat Online Tools

Python / Atlassian Confluence Cloud / Get theme

Back to Collection Items

import sys
import chilkat2

# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.

http = chilkat2.Http()

# Adds the "Authorization: Bearer <access_token>" header.
http.AuthToken = "<access_token>"

sbResponseBody = chilkat2.StringBuilder()
success = http.QuickGetSb("https://your-domain.atlassian.net/wiki/rest/api/settings/theme/:themeKey",sbResponseBody)
if (success == False):
    print(http.LastErrorText)
    sys.exit()

jResp = chilkat2.JsonObject()
jResp.LoadSb(sbResponseBody)
jResp.EmitCompact = False

print("Response Body:")
print(jResp.Emit())

respStatusCode = http.LastStatus
print("Response Status Code = " + str(respStatusCode))
if (respStatusCode >= 400):
    print("Response Header:")
    print(http.LastHeader)
    print("Failed.")
    sys.exit()

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
https://your-domain.atlassian.net/wiki/rest/api/settings/theme/:themeKey

Postman Collection Item JSON

{
  "name": "Get theme",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/api/settings/theme/:themeKey",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "settings",
        "theme",
        ":themeKey"
      ],
      "variable": [
        {
          "key": "themeKey",
          "value": "<string>",
          "type": "string",
          "description": "(Required) The key of the theme to be returned."
        }
      ]
    },
    "description": "Returns a theme. This includes information about the theme name,\ndescription, and icon.\n\n**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None"
  },
  "response": [
    {
      "name": "Returned if the requested theme is returned.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": {
              "content": "Added as a part of security scheme: oauth2",
              "type": "text/plain"
            },
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/settings/theme/:themeKey",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "settings",
            "theme",
            ":themeKey"
          ],
          "variable": [
            {
              "key": "themeKey"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{}"
    },
    {
      "name": "Returned if there is no theme with the given key.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": {
              "content": "Added as a part of security scheme: oauth2",
              "type": "text/plain"
            },
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/settings/theme/:themeKey",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "settings",
            "theme",
            ":themeKey"
          ],
          "variable": [
            {
              "key": "themeKey"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}