Back to Collection Items
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
Local $bSuccess
$oHttp.SetRequestHeader "Accept","application/json"
Local $oResp = $oHttp.QuickRequest("DELETE","https://api.app.ddog-gov.com/api/v2/powerpacks/:powerpack_id")
If ($oHttp.LastMethodSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
Local $iRespStatusCode = $oResp.StatusCode
ConsoleWrite("Response Status Code = " & $iRespStatusCode & @CRLF)
If ($iRespStatusCode <> 204) Then
ConsoleWrite("Response Header:" & @CRLF)
ConsoleWrite($oResp.Header & @CRLF)
ConsoleWrite("Response Body:" & @CRLF)
ConsoleWrite($oResp.BodyStr & @CRLF)
ConsoleWrite("Failed." & @CRLF)
Exit
EndIf
ConsoleWrite("Success." & @CRLF)
Curl Command
curl -X DELETE
-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v2/powerpacks/:powerpack_id
Postman Collection Item JSON
{
"name": "Delete a powerpack",
"request": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/powerpacks/:powerpack_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"powerpacks",
":powerpack_id"
],
"variable": [
{
"key": "powerpack_id",
"value": "<string>"
}
]
},
"description": "Delete a powerpack."
},
"response": [
{
"name": "OK",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": "Added as a part of security scheme: apikey",
"key": "DD-API-KEY",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/powerpacks/:powerpack_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"powerpacks",
":powerpack_id"
],
"variable": [
{
"key": "powerpack_id"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
],
"cookie": [
],
"body": ""
},
{
"name": "Powerpack Not Found",
"originalRequest": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"description": "Added as a part of security scheme: apikey",
"key": "DD-API-KEY",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/powerpacks/:powerpack_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"powerpacks",
":powerpack_id"
],
"variable": [
{
"key": "powerpack_id"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n \"<string>\",\n \"<string>\"\n ]\n}"
},
{
"name": "Too many requests",
"originalRequest": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"description": "Added as a part of security scheme: apikey",
"key": "DD-API-KEY",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/powerpacks/:powerpack_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"powerpacks",
":powerpack_id"
],
"variable": [
{
"key": "powerpack_id"
}
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n \"<string>\",\n \"<string>\"\n ]\n}"
}
]
}