Back to Collection Items
IncludeFile "CkJsonObject.pb"
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkHttp.pb"
IncludeFile "CkHttpResponse.pb"
Procedure ChilkatExample()
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
http.i = CkHttp::ckCreate()
If http.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success.i
queryParams.i = CkJsonObject::ckCreate()
If queryParams.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckUpdateString(queryParams,"expand","<string>")
CkJsonObject::ckUpdateString(queryParams,"expand","<string>")
; Adds the "Authorization: Bearer <access_token>" header.
CkHttp::setCkAuthToken(http, "<access_token>")
resp.i = CkHttp::ckQuickRequestParams(http,"GET","https://your-domain.atlassian.net/wiki/rest/api/space/:spaceKey/property/:key",queryParams)
If CkHttp::ckLastMethodSuccess(http) = 0
Debug CkHttp::ckLastErrorText(http)
CkHttp::ckDispose(http)
CkJsonObject::ckDispose(queryParams)
ProcedureReturn
EndIf
sbResponseBody.i = CkStringBuilder::ckCreate()
If sbResponseBody.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkHttpResponse::ckGetBodySb(resp,sbResponseBody)
jResp.i = CkJsonObject::ckCreate()
If jResp.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckLoadSb(jResp,sbResponseBody)
CkJsonObject::setCkEmitCompact(jResp, 0)
Debug "Response Body:"
Debug CkJsonObject::ckEmit(jResp)
respStatusCode.i = CkHttpResponse::ckStatusCode(resp)
Debug "Response Status Code = " + Str(respStatusCode)
If respStatusCode >= 400
Debug "Response Header:"
Debug CkHttpResponse::ckHeader(resp)
Debug "Failed."
CkHttpResponse::ckDispose(resp)
CkHttp::ckDispose(http)
CkJsonObject::ckDispose(queryParams)
CkStringBuilder::ckDispose(sbResponseBody)
CkJsonObject::ckDispose(jResp)
ProcedureReturn
EndIf
CkHttpResponse::ckDispose(resp)
; Sample JSON response:
; (Sample code for parsing the JSON response is shown below)
; {
; "id": -13429300,
; "key": "ut veniam dolor",
; "value": {},
; "_expandable": {
; "version": "cillum officia ipsum ut",
; "space": "in Lorem consectetur"
; },
; "version": {
; "when": "1951-11-29T18:04:27.736Z",
; "message": "dolore magna nisi incididunt",
; "number": -49820236,
; "minorEdit": true
; },
; "space": {
; "id": -20471082,
; "key": "in pr",
; "name": "culpa dolor si",
; "type": "irure dolor ea aliquip",
; "status": "sed ex",
; "_expandable": {
; "settings": "exercitation ea nisi Lorem",
; "metadata": "elit",
; "operations": "Lorem consequat aliquip",
; "lookAndFeel": "non occaecat nisi dolor",
; "permissions": "pariatur cupidatat dolor sed dolor",
; "icon": "aliquip",
; "description": "in",
; "theme": "qui",
; "history": "et fugiat culpa irure amet",
; "homepage": "commodo ut amet aute sint"
; },
; "_links": {},
; "icon": {
; "path": "laborum velit dolore",
; "width": -4680192,
; "height": 21898365,
; "isDefault": false
; },
; "description": {
; "plain": {
; "value": "sit deserunt",
; "representation": "plain",
; "embeddedContent": [
; {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; },
; {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; }
; ]
; },
; "view": {
; "value": "commodo dolore do",
; "representation": "plain",
; "embeddedContent": [
; {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; },
; {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; }
; ]
; }
; },
; "homepage": {
; "value": "<Circular reference to #/components/schemas/Content detected>"
; },
; "metadata": {
; "labels": {
; "results": [
; {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; },
; {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; }
; ],
; "start": 4373903,
; "limit": -70310049,
; "size": -89717135,
; "_links": {}
; }
; },
; "operations": [
; {
; "operation": "update",
; "targetType": "space"
; },
; {
; "operation": "update",
; "targetType": "attachment"
; }
; ],
; "permissions": [
; {
; "subjects": {
; "_expandable": {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; },
; "user": {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; },
; "group": {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; }
; },
; "operation": {
; "operation": "restore",
; "targetType": "comment"
; },
; "anonymousAccess": false,
; "unlicensedAccess": false
; },
; {
; "subjects": {
; "_expandable": {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; },
; "user": {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; },
; "group": {
; "value": "<Error: Too many levels of nesting to fake this schema>"
; }
; },
; "operation": {
; "operation": "export",
; "targetType": "attachment"
; },
; "anonymousAccess": false,
; "unlicensedAccess": false
; }
; ],
; "settings": {
; "routeOverrideEnabled": false,
; "_links": {}
; },
; "theme": {},
; "lookAndFeel": {
; "headings": {
; "color": "<string>"
; },
; "links": {
; "color": "<string>"
; },
; "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": "<string>"
; }
; },
; "history": {
; "createdDate": "1978-05-15T09:31:11.737Z"
; }
; }
; }
; Sample code for parsing the JSON response...
; Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
value.s
operation.s
targetType.s
v_expandableValue.s
UserValue.s
GroupValue.s
Operation.s
TargetType.s
anonymousAccess.i
unlicensedAccess.i
id.i = CkJsonObject::ckIntOf(jResp,"id")
key.s = CkJsonObject::ckStringOf(jResp,"key")
Version.s = CkJsonObject::ckStringOf(jResp,"_expandable.version")
Space.s = CkJsonObject::ckStringOf(jResp,"_expandable.space")
When.s = CkJsonObject::ckStringOf(jResp,"version.when")
Message.s = CkJsonObject::ckStringOf(jResp,"version.message")
v_Number.i = CkJsonObject::ckIntOf(jResp,"version.number")
MinorEdit.i = CkJsonObject::ckBoolOf(jResp,"version.minorEdit")
Id.i = CkJsonObject::ckIntOf(jResp,"space.id")
Key.s = CkJsonObject::ckStringOf(jResp,"space.key")
Name.s = CkJsonObject::ckStringOf(jResp,"space.name")
v_Type.s = CkJsonObject::ckStringOf(jResp,"space.type")
Status.s = CkJsonObject::ckStringOf(jResp,"space.status")
Settings.s = CkJsonObject::ckStringOf(jResp,"space._expandable.settings")
Metadata.s = CkJsonObject::ckStringOf(jResp,"space._expandable.metadata")
Operations.s = CkJsonObject::ckStringOf(jResp,"space._expandable.operations")
LookAndFeel.s = CkJsonObject::ckStringOf(jResp,"space._expandable.lookAndFeel")
Permissions.s = CkJsonObject::ckStringOf(jResp,"space._expandable.permissions")
Icon.s = CkJsonObject::ckStringOf(jResp,"space._expandable.icon")
Description.s = CkJsonObject::ckStringOf(jResp,"space._expandable.description")
Theme.s = CkJsonObject::ckStringOf(jResp,"space._expandable.theme")
History.s = CkJsonObject::ckStringOf(jResp,"space._expandable.history")
Homepage.s = CkJsonObject::ckStringOf(jResp,"space._expandable.homepage")
Path.s = CkJsonObject::ckStringOf(jResp,"space.icon.path")
Width.i = CkJsonObject::ckIntOf(jResp,"space.icon.width")
Height.i = CkJsonObject::ckIntOf(jResp,"space.icon.height")
IsDefault.i = CkJsonObject::ckBoolOf(jResp,"space.icon.isDefault")
Value.s = CkJsonObject::ckStringOf(jResp,"space.description.plain.value")
Representation.s = CkJsonObject::ckStringOf(jResp,"space.description.plain.representation")
ViewValue.s = CkJsonObject::ckStringOf(jResp,"space.description.view.value")
ViewRepresentation.s = CkJsonObject::ckStringOf(jResp,"space.description.view.representation")
HomepageValue.s = CkJsonObject::ckStringOf(jResp,"space.homepage.value")
Start.i = CkJsonObject::ckIntOf(jResp,"space.metadata.labels.start")
Limit.i = CkJsonObject::ckIntOf(jResp,"space.metadata.labels.limit")
Size.i = CkJsonObject::ckIntOf(jResp,"space.metadata.labels.size")
RouteOverrideEnabled.i = CkJsonObject::ckBoolOf(jResp,"space.settings.routeOverrideEnabled")
Color.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.headings.color")
LinksColor.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.links.color")
HoverOrFocusValue.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.menus.hoverOrFocus.value")
ColorValue.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.menus.color.value")
BackgroundColorValue.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.header.backgroundColor.value")
ButtonValue.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.header.button.value")
PrimaryNavigationValue.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.header.primaryNavigation.value")
SecondaryNavigationValue.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.header.secondaryNavigation.value")
SearchValue.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.header.search.value")
ScreenValue.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.content.screen.value")
ContainerValue.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.content.container.value")
HeaderValue.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.content.header.value")
BodyValue.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.content.body.value")
BordersAndDividersColor.s = CkJsonObject::ckStringOf(jResp,"space.lookAndFeel.bordersAndDividers.color")
CreatedDate.s = CkJsonObject::ckStringOf(jResp,"space.history.createdDate")
i.i = 0
count_i.i = CkJsonObject::ckSizeOfArray(jResp,"space.description.plain.embeddedContent")
While i < count_i
CkJsonObject::setCkI(jResp, i)
value = CkJsonObject::ckStringOf(jResp,"space.description.plain.embeddedContent[i].value")
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"space.description.view.embeddedContent")
While i < count_i
CkJsonObject::setCkI(jResp, i)
value = CkJsonObject::ckStringOf(jResp,"space.description.view.embeddedContent[i].value")
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"space.metadata.labels.results")
While i < count_i
CkJsonObject::setCkI(jResp, i)
value = CkJsonObject::ckStringOf(jResp,"space.metadata.labels.results[i].value")
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"space.operations")
While i < count_i
CkJsonObject::setCkI(jResp, i)
operation = CkJsonObject::ckStringOf(jResp,"space.operations[i].operation")
targetType = CkJsonObject::ckStringOf(jResp,"space.operations[i].targetType")
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"space.permissions")
While i < count_i
CkJsonObject::setCkI(jResp, i)
v_expandableValue = CkJsonObject::ckStringOf(jResp,"space.permissions[i].subjects._expandable.value")
UserValue = CkJsonObject::ckStringOf(jResp,"space.permissions[i].subjects.user.value")
GroupValue = CkJsonObject::ckStringOf(jResp,"space.permissions[i].subjects.group.value")
Operation = CkJsonObject::ckStringOf(jResp,"space.permissions[i].operation.operation")
TargetType = CkJsonObject::ckStringOf(jResp,"space.permissions[i].operation.targetType")
anonymousAccess = CkJsonObject::ckBoolOf(jResp,"space.permissions[i].anonymousAccess")
unlicensedAccess = CkJsonObject::ckBoolOf(jResp,"space.permissions[i].unlicensedAccess")
i = i + 1
Wend
CkHttp::ckDispose(http)
CkJsonObject::ckDispose(queryParams)
CkStringBuilder::ckDispose(sbResponseBody)
CkJsonObject::ckDispose(jResp)
ProcedureReturn
EndProcedure
Curl Command
curl -G -d "expand=%3Cstring%3E"
-d "expand=%3Cstring%3E"
-H "Authorization: Bearer <access_token>"
https://your-domain.atlassian.net/wiki/rest/api/space/:spaceKey/property/:key
Postman Collection Item JSON
{
"name": "Get space property",
"request": {
"auth": {
"type": "oauth2"
},
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/space/:spaceKey/property/:key?expand=<string>&expand=<string>",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"space",
":spaceKey",
"property",
":key"
],
"query": [
{
"key": "expand",
"value": "<string>",
"description": "A multi-value parameter indicating which properties of the space\nproperty to expand. By default, the `version` object is expanded.\n\n- `version` returns information about the version of the content.\n- `space` returns the space that the properties are in."
},
{
"key": "expand",
"value": "<string>",
"description": "A multi-value parameter indicating which properties of the space\nproperty to expand. By default, the `version` object is expanded.\n\n- `version` returns information about the version of the content.\n- `space` returns the space that the properties are in."
}
],
"variable": [
{
"key": "spaceKey",
"value": "<string>",
"type": "string",
"description": "(Required) The key of the space that the property is in."
},
{
"key": "key",
"value": "<string>",
"type": "string",
"description": "(Required) The key of the space property."
}
]
},
"description": "Returns a space property.\n\n**[Permissions required](https://confluence.atlassian.com/x/_AozKw)**: ‘View’ permission for the space."
},
"response": [
{
"name": "Returned if the requested space property 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/space/:spaceKey/property/:key?expand=<string>&expand=<string>",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"space",
":spaceKey",
"property",
":key"
],
"query": [
{
"key": "expand",
"value": "<string>"
},
{
"key": "expand",
"value": "<string>"
}
],
"variable": [
{
"key": "spaceKey"
},
{
"key": "key"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"id\": -13429300,\n \"key\": \"ut veniam dolor\",\n \"value\": {},\n \"_expandable\": {\n \"version\": \"cillum officia ipsum ut\",\n \"space\": \"in Lorem consectetur\"\n },\n \"version\": {\n \"when\": \"1951-11-29T18:04:27.736Z\",\n \"message\": \"dolore magna nisi incididunt\",\n \"number\": -49820236,\n \"minorEdit\": true\n },\n \"space\": {\n \"id\": -20471082,\n \"key\": \"in pr\",\n \"name\": \"culpa dolor si\",\n \"type\": \"irure dolor ea aliquip\",\n \"status\": \"sed ex\",\n \"_expandable\": {\n \"settings\": \"exercitation ea nisi Lorem\",\n \"metadata\": \"elit\",\n \"operations\": \"Lorem consequat aliquip\",\n \"lookAndFeel\": \"non occaecat nisi dolor\",\n \"permissions\": \"pariatur cupidatat dolor sed dolor\",\n \"icon\": \"aliquip\",\n \"description\": \"in\",\n \"theme\": \"qui\",\n \"history\": \"et fugiat culpa irure amet\",\n \"homepage\": \"commodo ut amet aute sint\"\n },\n \"_links\": {},\n \"icon\": {\n \"path\": \"laborum velit dolore\",\n \"width\": -4680192,\n \"height\": 21898365,\n \"isDefault\": false\n },\n \"description\": {\n \"plain\": {\n \"value\": \"sit deserunt\",\n \"representation\": \"plain\",\n \"embeddedContent\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ]\n },\n \"view\": {\n \"value\": \"commodo dolore do\",\n \"representation\": \"plain\",\n \"embeddedContent\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ]\n }\n },\n \"homepage\": {\n \"value\": \"<Circular reference to #/components/schemas/Content detected>\"\n },\n \"metadata\": {\n \"labels\": {\n \"results\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ],\n \"start\": 4373903,\n \"limit\": -70310049,\n \"size\": -89717135,\n \"_links\": {}\n }\n },\n \"operations\": [\n {\n \"operation\": \"update\",\n \"targetType\": \"space\"\n },\n {\n \"operation\": \"update\",\n \"targetType\": \"attachment\"\n }\n ],\n \"permissions\": [\n {\n \"subjects\": {\n \"_expandable\": {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n \"user\": {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n \"group\": {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n },\n \"operation\": {\n \"operation\": \"restore\",\n \"targetType\": \"comment\"\n },\n \"anonymousAccess\": false,\n \"unlicensedAccess\": false\n },\n {\n \"subjects\": {\n \"_expandable\": {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n \"user\": {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n \"group\": {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n },\n \"operation\": {\n \"operation\": \"export\",\n \"targetType\": \"attachment\"\n },\n \"anonymousAccess\": false,\n \"unlicensedAccess\": false\n }\n ],\n \"settings\": {\n \"routeOverrideEnabled\": false,\n \"_links\": {}\n },\n \"theme\": {},\n \"lookAndFeel\": {\n \"headings\": {\n \"color\": \"<string>\"\n },\n \"links\": {\n \"color\": \"<string>\"\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\": \"<string>\"\n }\n },\n \"history\": {\n \"createdDate\": \"1978-05-15T09:31:11.737Z\"\n }\n }\n}"
},
{
"name": "Returned if any of the following is true:\n\n- There is no space with the given key.\n- There is no property with the given key.\n- The calling user does not have permission to view the space.",
"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/space/:spaceKey/property/:key?expand=<string>&expand=<string>",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"space",
":spaceKey",
"property",
":key"
],
"query": [
{
"key": "expand",
"value": "<string>"
},
{
"key": "expand",
"value": "<string>"
}
],
"variable": [
{
"key": "spaceKey"
},
{
"key": "key"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}