Back to Collection Items
#include <C_CkHttp.h>
#include <C_CkHttpResponse.h>
void ChilkatSample(void)
{
HCkHttp http;
BOOL success;
HCkHttpResponse resp;
int respStatusCode;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttp_Create();
// Adds the "Authorization: Bearer <access_token>" header.
CkHttp_putAuthToken(http,"<access_token>");
resp = CkHttp_QuickRequest(http,"DELETE","https://your-domain.atlassian.net/wiki/rest/api/user/watch/space/:spaceKey?key=<string>&username=<string>&accountId=<string>");
if (CkHttp_getLastMethodSuccess(http) == FALSE) {
printf("%s\n",CkHttp_lastErrorText(http));
CkHttp_Dispose(http);
return;
}
respStatusCode = CkHttpResponse_getStatusCode(resp);
printf("Response Status Code = %d\n",respStatusCode);
if (respStatusCode != 204) {
printf("Response Header:\n");
printf("%s\n",CkHttpResponse_header(resp));
printf("Response Body:\n");
printf("%s\n",CkHttpResponse_bodyStr(resp));
printf("Failed.\n");
CkHttpResponse_Dispose(resp);
CkHttp_Dispose(http);
return;
}
CkHttpResponse_Dispose(resp);
printf("Success.\n");
CkHttp_Dispose(http);
}
Curl Command
curl -X DELETE
-H "Authorization: Bearer <access_token>"
https://your-domain.atlassian.net/wiki/rest/api/user/watch/space/:spaceKey?key=<string>&username=<string>&accountId=<string>
Postman Collection Item JSON
{
"name": "Remove space watch",
"request": {
"auth": {
"type": "oauth2"
},
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/user/watch/space/:spaceKey?key=<string>&username=<string>&accountId=<string>",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"user",
"watch",
"space",
":spaceKey"
],
"query": [
{
"key": "key",
"value": "<string>",
"description": "This parameter is no longer available and will be removed from the documentation soon.\nUse `accountId` instead.\nSee the [deprecation notice](/cloud/confluence/deprecation-notice-user-privacy-api-migration-guide/) for details."
},
{
"key": "username",
"value": "<string>",
"description": "This parameter is no longer available and will be removed from the documentation soon.\nUse `accountId` instead.\nSee the [deprecation notice](/cloud/confluence/deprecation-notice-user-privacy-api-migration-guide/) for details."
},
{
"key": "accountId",
"value": "<string>",
"description": "(Required) The `accountId` of the user to be removed as a watcher. The accountId uniquely identifies the user across all\nAtlassian products. For example, `384093:32b4d9w0-f6a5-3535-11a3-9c8c88d10192`."
}
],
"variable": [
{
"key": "spaceKey",
"value": "<string>",
"type": "string",
"description": "(Required) The key of the space to remove the watcher from."
}
]
},
"description": "Removes a user as a watcher from a space. Choose the user by doing one of\nthe following:\n\n- Specify a user via a query parameter: Use the `accountId` to identify the user.\n- Do not specify a user: The currently logged-in user will be used.\n\n**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:\n'Confluence Administrator' global permission if specifying a user, otherwise\npermission to access the Confluence site ('Can use' global permission)."
},
"response": [
{
"name": "Returned if the watcher was successfully deleted. No response body is returned.",
"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/user/watch/space/:spaceKey?key=<string>&username=<string>&accountId=<string>",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"user",
"watch",
"space",
":spaceKey"
],
"query": [
{
"key": "key",
"value": "<string>"
},
{
"key": "username",
"value": "<string>"
},
{
"key": "accountId",
"value": "<string>"
}
],
"variable": [
{
"key": "spaceKey"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Returned if;\n\n- The `X-Atlassian-Token: no-check` header is not specified.\n- The calling user does not have permission to view the space.\n- A user is specified via a query parameter and the calling user is\nnot a Confluence administrator.\n- No space exists",
"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/user/watch/space/:spaceKey?key=<string>&username=<string>&accountId=<string>",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"user",
"watch",
"space",
":spaceKey"
],
"query": [
{
"key": "key",
"value": "<string>"
},
{
"key": "username",
"value": "<string>"
},
{
"key": "accountId",
"value": "<string>"
}
],
"variable": [
{
"key": "spaceKey"
}
]
}
},
"status": "Forbidden",
"code": 403,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Returned if no `spaceKey` is specified.",
"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/user/watch/space/:spaceKey?key=<string>&username=<string>&accountId=<string>",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"user",
"watch",
"space",
":spaceKey"
],
"query": [
{
"key": "key",
"value": "<string>"
},
{
"key": "username",
"value": "<string>"
},
{
"key": "accountId",
"value": "<string>"
}
],
"variable": [
{
"key": "spaceKey"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}