Chilkat Online Tools

Objective-C / Atlassian Confluence Cloud / Delete space property

Back to Collection Items

#import <CkoHttp.h>
#import <CkoHttpResponse.h>

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

CkoHttp *http = [[CkoHttp alloc] init];
BOOL success;

// Adds the "Authorization: Bearer <access_token>" header.
http.AuthToken = @"<access_token>";

CkoHttpResponse *resp = [http QuickRequest: @"DELETE" url: @"https://your-domain.atlassian.net/wiki/rest/api/space/:spaceKey/property/:key"];
if (http.LastMethodSuccess == NO) {
    NSLog(@"%@",http.LastErrorText);
    return;
}

int respStatusCode = [resp.StatusCode intValue];
NSLog(@"%@%d",@"Response Status Code = ",respStatusCode);
if (respStatusCode != 204) {
    NSLog(@"%@",@"Response Header:");
    NSLog(@"%@",resp.Header);
    NSLog(@"%@",@"Response Body:");
    NSLog(@"%@",resp.BodyStr);
    NSLog(@"%@",@"Failed.");

    return;
}

NSLog(@"%@",@"Success.");

Curl Command

curl -X DELETE
	-H "Authorization: Bearer <access_token>"
https://your-domain.atlassian.net/wiki/rest/api/space/:spaceKey/property/:key

Postman Collection Item JSON

{
  "name": "Delete space property",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/api/space/:spaceKey/property/:key",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "space",
        ":spaceKey",
        "property",
        ":key"
      ],
      "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 property to be deleted."
        }
      ]
    },
    "description": "Deletes a space property.\n\n**[Permissions required](https://confluence.atlassian.com/x/_AozKw)**:\n‘Admin’ permission for the space."
  },
  "response": [
    {
      "name": "Returned if the space property is deleted.",
      "originalRequest": {
        "method": "DELETE",
        "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",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "space",
            ":spaceKey",
            "property",
            ":key"
          ],
          "variable": [
            {
              "key": "spaceKey"
            },
            {
              "key": "key"
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Returned if any of the following is true:\n\n- There is no space with the given spaceKey\n- There is no property with the given key.\n- The calling user does not have permission to view the space.",
      "originalRequest": {
        "method": "DELETE",
        "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",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "space",
            ":spaceKey",
            "property",
            ":key"
          ],
          "variable": [
            {
              "key": "spaceKey"
            },
            {
              "key": "key"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}