Back to Collection Items
#include <C_CkHttpW.h>
#include <C_CkHttpResponseW.h>
void ChilkatSample(void)
{
HCkHttpW http;
BOOL success;
HCkHttpResponseW resp;
int respStatusCode;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttpW_Create();
// Adds the "Authorization: Bearer <access_token>" header.
CkHttpW_putAuthToken(http,L"<access_token>");
resp = CkHttpW_QuickRequest(http,L"DELETE",L"https://your-domain.atlassian.net/wiki/rest/api/content/:id/label/:label");
if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
CkHttpW_Dispose(http);
return;
}
respStatusCode = CkHttpResponseW_getStatusCode(resp);
wprintf(L"Response Status Code = %d\n",respStatusCode);
if (respStatusCode != 204) {
wprintf(L"Response Header:\n");
wprintf(L"%s\n",CkHttpResponseW_header(resp));
wprintf(L"Response Body:\n");
wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp));
wprintf(L"Failed.\n");
CkHttpResponseW_Dispose(resp);
CkHttpW_Dispose(http);
return;
}
CkHttpResponseW_Dispose(resp);
wprintf(L"Success.\n");
CkHttpW_Dispose(http);
}
Curl Command
curl -X DELETE
-H "Authorization: Bearer <access_token>"
https://your-domain.atlassian.net/wiki/rest/api/content/:id/label/:label
Postman Collection Item JSON
{
"name": "Remove label from content",
"request": {
"auth": {
"type": "oauth2"
},
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/content/:id/label/:label",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"content",
":id",
"label",
":label"
],
"variable": [
{
"key": "id",
"value": "<string>",
"type": "string",
"description": "(Required) The ID of the content that the label will be removed from."
},
{
"key": "label",
"value": "<string>",
"type": "string",
"description": "(Required) The name of the label to be removed."
}
]
},
"description": "Removes a label from a piece of content. This is similar to\n[Remove label from content using query parameter](#api-content-id-label-delete)\nexcept that the label name is specified via a path parameter.\n\nUse this method if the label name does not have \"/\" characters, as the path\nparameter does not accept \"/\" characters for security reasons. Otherwise,\nuse [Remove label from content using query parameter](#api-content-id-label-delete).\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/:label",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"content",
":id",
"label",
":label"
],
"variable": [
{
"key": "id"
},
{
"key": "label"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Returned if the label name has a \"/\" character.",
"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/:label",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"content",
":id",
"label",
":label"
],
"variable": [
{
"key": "id"
},
{
"key": "label"
}
]
}
},
"status": "Bad Request",
"code": 400,
"_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/:label",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"content",
":id",
"label",
":label"
],
"variable": [
{
"key": "id"
},
{
"key": "label"
}
]
}
},
"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/:label",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"content",
":id",
"label",
":label"
],
"variable": [
{
"key": "id"
},
{
"key": "label"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}