Chilkat Online Tools

Foxpro / Atlassian Confluence Cloud / Remove label from content using query parameter

Back to Collection Items

LOCAL loHttp
LOCAL lnSuccess
LOCAL loResp
LOCAL lnRespStatusCode

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

loHttp = CreateObject('Chilkat_9_5_0.Http')

* Adds the "Authorization: Bearer <access_token>" header.
loHttp.AuthToken = "<access_token>"

loResp = loHttp.QuickRequest("DELETE","https://your-domain.atlassian.net/wiki/rest/api/content/:id/label?name=<string>")
IF (loHttp.LastMethodSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    CANCEL
ENDIF

lnRespStatusCode = loResp.StatusCode
? "Response Status Code = " + STR(lnRespStatusCode)
IF (lnRespStatusCode <> 204) THEN
    ? "Response Header:"
    ? loResp.Header
    ? "Response Body:"
    ? loResp.BodyStr
    ? "Failed."
    RELEASE loResp
    RELEASE loHttp
    CANCEL
ENDIF

RELEASE loResp
? "Success."

RELEASE loHttp

Curl Command

curl -X DELETE
	-H "Authorization: Bearer <access_token>"
https://your-domain.atlassian.net/wiki/rest/api/content/:id/label?name=<string>

Postman Collection Item JSON

{
  "name": "Remove label from content using query parameter",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/api/content/:id/label?name=<string>",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "content",
        ":id",
        "label"
      ],
      "query": [
        {
          "key": "name",
          "value": "<string>",
          "description": "(Required) The name of the label to be removed."
        }
      ],
      "variable": [
        {
          "key": "id",
          "value": "<string>",
          "type": "string",
          "description": "(Required) The ID of the content that the label will be removed from."
        }
      ]
    },
    "description": "Removes a label from a piece of content. This is similar to\n[Remove label from content](#api-content-id-label-label-delete)\nexcept that the label name is specified via a query parameter.\n\nUse this method if the label name has \"/\" characters, as\n[Remove label from content using query parameter](#api-content-id-label-delete)\ndoes not accept \"/\" characters for the label name.\n\n**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:\nPermission to update the content."
  },
  "response": [
    {
      "name": "Returned if the label is removed. The response body will be empty.",
      "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/content/:id/label?name=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "content",
            ":id",
            "label"
          ],
          "query": [
            {
              "key": "name",
              "value": "<string>"
            }
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Returned if the calling user can view but not edit the content.",
      "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/content/:id/label?name=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "content",
            ":id",
            "label"
          ],
          "query": [
            {
              "key": "name",
              "value": "<string>"
            }
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Forbidden",
      "code": 403,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Returned if;\n\n- There is no content with the given ID.\n- The calling user does not have permission to view the content.",
      "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/content/:id/label?name=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "content",
            ":id",
            "label"
          ],
          "query": [
            {
              "key": "name",
              "value": "<string>"
            }
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}