Chilkat Online Tools

unicodeC / Squadcast API V3 / Delete Squad

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://api.squadcast.com/v3/squads/:squadID");
    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://api.squadcast.com/v3/squads/:squadID

Postman Collection Item JSON

{
  "name": "Delete Squad",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{sq_pb_auth_header}}",
          "type": "string"
        }
      ]
    },
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/squads/:squadID",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "squads",
        ":squadID"
      ],
      "variable": [
        {
          "key": "squadID",
          "value": "5ed4e5977cc8a1daa90d56eb",
          "type": "string"
        }
      ]
    },
    "description": "This endpoint is used to delete the squad. Squad should be assigned to any incident or part of any escalation policy.\nRequires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `squad-update` scope."
  },
  "response": [
    {
      "name": "204 No Content",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{baseUrl}}/squads/:squadID",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "squads",
            ":squadID"
          ],
          "variable": [
            {
              "key": "squadID",
              "value": "5ed4e5977cc8a1daa90d56eb"
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "json",
      "header": null,
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "401 Unauthorized",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{baseUrl}}/squads/:squadID",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "squads",
            ":squadID"
          ],
          "variable": [
            {
              "key": "squadID",
              "value": "5ed4e5977cc8a1daa90d56eb"
            }
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": null,
      "cookie": [
      ],
      "body": "{\n    \"meta\": {\n        \"status\": 401,\n        \"error_message\": \"<string>\"\n    }\n}"
    },
    {
      "name": "403 Forbidden",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{baseUrl}}/squads/:squadID",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "squads",
            ":squadID"
          ],
          "variable": [
            {
              "key": "squadID",
              "value": "5ed4e5977cc8a1daa90d56eb"
            }
          ]
        }
      },
      "status": "Forbidden",
      "code": 403,
      "_postman_previewlanguage": "json",
      "header": null,
      "cookie": [
      ],
      "body": "{\n    \"meta\": {\n        \"status\": 403,\n        \"error_message\": \"<string>\"\n    }\n}"
    },
    {
      "name": "404 Not Found",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{baseUrl}}/squads/:squadID",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "squads",
            ":squadID"
          ],
          "variable": [
            {
              "key": "squadID",
              "value": "5ed4e5977cc8a1daa90d56eb"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "json",
      "header": null,
      "cookie": [
      ],
      "body": "{\n    \"meta\": {\n        \"status\": 404,\n        \"error_message\": \"<string>\"\n    }\n}"
    },
    {
      "name": "500 Internal Server Error",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{baseUrl}}/squads/:squadID",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "squads",
            ":squadID"
          ],
          "variable": [
            {
              "key": "squadID",
              "value": "5ed4e5977cc8a1daa90d56eb"
            }
          ]
        }
      },
      "status": "Internal Server Error",
      "code": 500,
      "_postman_previewlanguage": "json",
      "header": null,
      "cookie": [
      ],
      "body": "{\n    \"meta\": {\n        \"status\": 500,\n        \"error_message\": \"<string>\"\n    }\n}"
    }
  ]
}