Chilkat Online Tools

autoit / Atlassian Confluence Cloud / Get look and feel settings

Back to Collection Items

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

$oHttp = ObjCreate("Chilkat_9_5_0.Http")
Local $bSuccess

$oQueryParams = ObjCreate("Chilkat_9_5_0.JsonObject")
$oQueryParams.UpdateString("spaceKey","<string>")

; Adds the "Authorization: Bearer <access_token>" header.
$oHttp.AuthToken = "<access_token>"

Local $oResp = $oHttp.QuickRequestParams("GET","https://your-domain.atlassian.net/wiki/rest/api/settings/lookandfeel",$oQueryParams)
If ($oHttp.LastMethodSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

$oSbResponseBody = ObjCreate("Chilkat_9_5_0.StringBuilder")
$oResp.GetBodySb($oSbResponseBody)

$oJResp = ObjCreate("Chilkat_9_5_0.JsonObject")
$oJResp.LoadSb($oSbResponseBody)
$oJResp.EmitCompact = False

ConsoleWrite("Response Body:" & @CRLF)
ConsoleWrite($oJResp.Emit() & @CRLF)

Local $iRespStatusCode = $oResp.StatusCode
ConsoleWrite("Response Status Code = " & $iRespStatusCode & @CRLF)
If ($iRespStatusCode >= 400) Then
    ConsoleWrite("Response Header:" & @CRLF)
    ConsoleWrite($oResp.Header & @CRLF)
    ConsoleWrite("Failed." & @CRLF)

    Exit
EndIf

; Sample JSON response:
; (Sample code for parsing the JSON response is shown below)

; {
;   "selected": "global",
;   "global": {
;     "headings": {
;       "color": "veniam in ex velit"
;     },
;     "links": {
;       "color": "fugiat irure dolor nulla"
;     },
;     "menus": {
;       "hoverOrFocus": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "color": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       }
;     },
;     "header": {
;       "backgroundColor": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "button": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "primaryNavigation": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "secondaryNavigation": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "search": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       }
;     },
;     "content": {
;       "screen": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "container": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "header": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "body": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       }
;     },
;     "bordersAndDividers": {
;       "color": "in"
;     }
;   },
;   "custom": {
;     "headings": {
;       "color": "elit aliquip nulla aliqua"
;     },
;     "links": {
;       "color": "aliquip consequat ut occaecat"
;     },
;     "menus": {
;       "hoverOrFocus": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "color": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       }
;     },
;     "header": {
;       "backgroundColor": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "button": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "primaryNavigation": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "secondaryNavigation": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "search": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       }
;     },
;     "content": {
;       "screen": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "container": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "header": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "body": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       }
;     },
;     "bordersAndDividers": {
;       "color": "ut ut"
;     }
;   },
;   "theme": {
;     "headings": {
;       "color": "l"
;     },
;     "links": {
;       "color": "qui do laborum ut"
;     },
;     "menus": {
;       "hoverOrFocus": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "color": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       }
;     },
;     "header": {
;       "backgroundColor": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "button": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "primaryNavigation": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "secondaryNavigation": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "search": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       }
;     },
;     "content": {
;       "screen": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "container": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "header": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       },
;       "body": {
;         "value": "<Error: Too many levels of nesting to fake this schema>"
;       }
;     },
;     "bordersAndDividers": {
;       "color": "quis dolore"
;     }
;   }
; }

; Sample code for parsing the JSON response...
; Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

Local $selected = $oJResp.StringOf("selected")
Local $sColor = $oJResp.StringOf("global.headings.color")
Local $sLinksColor = $oJResp.StringOf("global.links.color")
Local $sValue = $oJResp.StringOf("global.menus.hoverOrFocus.value")
Local $sColorValue = $oJResp.StringOf("global.menus.color.value")
Local $sBackgroundColorValue = $oJResp.StringOf("global.header.backgroundColor.value")
Local $sButtonValue = $oJResp.StringOf("global.header.button.value")
Local $sPrimaryNavigationValue = $oJResp.StringOf("global.header.primaryNavigation.value")
Local $sSecondaryNavigationValue = $oJResp.StringOf("global.header.secondaryNavigation.value")
Local $sSearchValue = $oJResp.StringOf("global.header.search.value")
Local $sScreenValue = $oJResp.StringOf("global.content.screen.value")
Local $sContainerValue = $oJResp.StringOf("global.content.container.value")
Local $sHeaderValue = $oJResp.StringOf("global.content.header.value")
Local $sBodyValue = $oJResp.StringOf("global.content.body.value")
Local $sBordersAndDividersColor = $oJResp.StringOf("global.bordersAndDividers.color")
Local $sHeadingsColor = $oJResp.StringOf("custom.headings.color")
$sLinksColor = $oJResp.StringOf("custom.links.color")
Local $sHoverOrFocusValue = $oJResp.StringOf("custom.menus.hoverOrFocus.value")
$sColorValue = $oJResp.StringOf("custom.menus.color.value")
$sBackgroundColorValue = $oJResp.StringOf("custom.header.backgroundColor.value")
$sButtonValue = $oJResp.StringOf("custom.header.button.value")
$sPrimaryNavigationValue = $oJResp.StringOf("custom.header.primaryNavigation.value")
$sSecondaryNavigationValue = $oJResp.StringOf("custom.header.secondaryNavigation.value")
$sSearchValue = $oJResp.StringOf("custom.header.search.value")
$sScreenValue = $oJResp.StringOf("custom.content.screen.value")
$sContainerValue = $oJResp.StringOf("custom.content.container.value")
$sHeaderValue = $oJResp.StringOf("custom.content.header.value")
$sBodyValue = $oJResp.StringOf("custom.content.body.value")
$sBordersAndDividersColor = $oJResp.StringOf("custom.bordersAndDividers.color")
$sHeadingsColor = $oJResp.StringOf("theme.headings.color")
$sLinksColor = $oJResp.StringOf("theme.links.color")
$sHoverOrFocusValue = $oJResp.StringOf("theme.menus.hoverOrFocus.value")
$sColorValue = $oJResp.StringOf("theme.menus.color.value")
$sBackgroundColorValue = $oJResp.StringOf("theme.header.backgroundColor.value")
$sButtonValue = $oJResp.StringOf("theme.header.button.value")
$sPrimaryNavigationValue = $oJResp.StringOf("theme.header.primaryNavigation.value")
$sSecondaryNavigationValue = $oJResp.StringOf("theme.header.secondaryNavigation.value")
$sSearchValue = $oJResp.StringOf("theme.header.search.value")
$sScreenValue = $oJResp.StringOf("theme.content.screen.value")
$sContainerValue = $oJResp.StringOf("theme.content.container.value")
$sHeaderValue = $oJResp.StringOf("theme.content.header.value")
$sBodyValue = $oJResp.StringOf("theme.content.body.value")
$sBordersAndDividersColor = $oJResp.StringOf("theme.bordersAndDividers.color")

Curl Command

curl -G -d "spaceKey=%3Cstring%3E"
	-H "Authorization: Bearer <access_token>"
https://your-domain.atlassian.net/wiki/rest/api/settings/lookandfeel

Postman Collection Item JSON

{
  "name": "Get look and feel settings",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/api/settings/lookandfeel?spaceKey=<string>",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "settings",
        "lookandfeel"
      ],
      "query": [
        {
          "key": "spaceKey",
          "value": "<string>",
          "description": "The key of the space for which the look and feel settings will be\nreturned. If this is not set, only the global look and feel settings\nare returned."
        }
      ]
    },
    "description": "Returns the look and feel settings for the site or a single space. This\nincludes attributes such as the color scheme, padding, and border radius.\n\nThe look and feel settings for a space can be inherited from the global\nlook and feel settings or provided by a theme.\n\n**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:\nNone"
  },
  "response": [
    {
      "name": "Returned if the requested look and feel settings are 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/lookandfeel?spaceKey=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "settings",
            "lookandfeel"
          ],
          "query": [
            {
              "key": "spaceKey",
              "value": "<string>"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"selected\": \"global\",\n \"global\": {\n  \"headings\": {\n   \"color\": \"veniam in ex velit\"\n  },\n  \"links\": {\n   \"color\": \"fugiat irure dolor nulla\"\n  },\n  \"menus\": {\n   \"hoverOrFocus\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"color\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   }\n  },\n  \"header\": {\n   \"backgroundColor\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"button\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"primaryNavigation\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"secondaryNavigation\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"search\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   }\n  },\n  \"content\": {\n   \"screen\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"container\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"header\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"body\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   }\n  },\n  \"bordersAndDividers\": {\n   \"color\": \"in\"\n  }\n },\n \"custom\": {\n  \"headings\": {\n   \"color\": \"elit aliquip nulla aliqua\"\n  },\n  \"links\": {\n   \"color\": \"aliquip consequat ut occaecat\"\n  },\n  \"menus\": {\n   \"hoverOrFocus\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"color\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   }\n  },\n  \"header\": {\n   \"backgroundColor\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"button\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"primaryNavigation\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"secondaryNavigation\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"search\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   }\n  },\n  \"content\": {\n   \"screen\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"container\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"header\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"body\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   }\n  },\n  \"bordersAndDividers\": {\n   \"color\": \"ut ut\"\n  }\n },\n \"theme\": {\n  \"headings\": {\n   \"color\": \"l\"\n  },\n  \"links\": {\n   \"color\": \"qui do laborum ut\"\n  },\n  \"menus\": {\n   \"hoverOrFocus\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"color\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   }\n  },\n  \"header\": {\n   \"backgroundColor\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"button\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"primaryNavigation\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"secondaryNavigation\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"search\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   }\n  },\n  \"content\": {\n   \"screen\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"container\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"header\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   },\n   \"body\": {\n    \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n   }\n  },\n  \"bordersAndDividers\": {\n   \"color\": \"quis dolore\"\n  }\n }\n}"
    },
    {
      "name": "Returned if `spaceKey` is invalid.",
      "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/lookandfeel?spaceKey=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "settings",
            "lookandfeel"
          ],
          "query": [
            {
              "key": "spaceKey",
              "value": "<string>"
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Returned if there is no space with the given `spaceKey`.",
      "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/lookandfeel?spaceKey=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "settings",
            "lookandfeel"
          ],
          "query": [
            {
              "key": "spaceKey",
              "value": "<string>"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}