Back to Collection Items
var os = require('os');
if (os.platform() == 'win32') {
if (os.arch() == 'ia32') {
var chilkat = require('@chilkat/ck-node21-win-ia32');
} else {
var chilkat = require('@chilkat/ck-node21-win64');
}
} else if (os.platform() == 'linux') {
if (os.arch() == 'arm') {
var chilkat = require('@chilkat/ck-node21-arm');
} else if (os.arch() == 'x86') {
var chilkat = require('@chilkat/ck-node21-linux32');
} else {
var chilkat = require('@chilkat/ck-node21-linux64');
}
} else if (os.platform() == 'darwin') {
if (os.arch() == 'arm64') {
var chilkat = require('@chilkat/ck-node21-mac-m1');
} else {
var chilkat = require('@chilkat/ck-node21-macosx');
}
}
function chilkatExample() {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
var http = new chilkat.Http();
var success;
http.BasicAuth = true;
http.Login = "username";
http.Password = "password";
// resp: HttpResponse
var resp = http.QuickRequest("DELETE","https://domain.com/v2/apps/{{appId}}/keys/:keyId");
if (http.LastMethodSuccess == false) {
console.log(http.LastErrorText);
return;
}
var sbResponseBody = new chilkat.StringBuilder();
resp.GetBodySb(sbResponseBody);
var jResp = new chilkat.JsonObject();
jResp.LoadSb(sbResponseBody);
jResp.EmitCompact = false;
console.log("Response Body:");
console.log(jResp.Emit());
var respStatusCode = resp.StatusCode;
console.log("Response Status Code = " + respStatusCode);
if (respStatusCode >= 400) {
console.log("Response Header:");
console.log(resp.Header);
console.log("Failed.");
return;
}
}
chilkatExample();
Curl Command
curl -X DELETE
-u 'username:password'
https://domain.com/v2/apps/{{appId}}/keys/:keyId
Postman Collection Item JSON
{
"name": "Delete App Key",
"_postman_id": "6b8e9940-c9b3-4f41-bf0c-ad3441a598d3",
"request": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{url}}/v2/apps/{{appId}}/keys/:keyId",
"host": [
"{{url}}"
],
"path": [
"v2",
"apps",
"{{appId}}",
"keys",
":keyId"
],
"variable": [
{
"key": "keyId"
}
]
},
"description": "Removes an API key."
},
"response": [
{
"id": "1d68f45f-b7db-4977-a088-b7e549298a89",
"name": "App not found",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": {
"content": "Added as a part of security scheme: bearer",
"type": "text/plain"
},
"key": "Authorization",
"value": "Bearer <token>"
}
],
"url": {
"raw": "{{baseUrl}}/v2/apps/:appId/keys/:keyId",
"host": [
"{{baseUrl}}"
],
"path": [
"v2",
"apps",
":appId",
"keys",
":keyId"
],
"variable": [
{
"key": "appId"
},
{
"key": "keyId"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"id": "5a7082b7-7c19-4f0e-9d2b-6ab10d703bbf",
"name": "Ok",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": {
"content": "Added as a part of security scheme: bearer",
"type": "text/plain"
},
"key": "Authorization",
"value": "Bearer <token>"
}
],
"url": {
"raw": "{{baseUrl}}/v2/apps/:appId/keys/:keyId",
"host": [
"{{baseUrl}}"
],
"path": [
"v2",
"apps",
":appId",
"keys",
":keyId"
],
"variable": [
{
"key": "appId"
},
{
"key": "keyId"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{}"
}
]
}