Chilkat Online Tools

unicodeC / Squadcast API V3 / Remove User

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();

    CkHttpW_SetRequestHeader(http,L"Authorization",L"");

    resp = CkHttpW_QuickRequest(http,L"DELETE",L"https://api.squadcast.com/v3/users/:userID");
    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: "
https://api.squadcast.com/v3/users/:userID

Postman Collection Item JSON

{
  "name": "Remove User",
  "request": {
    "auth": {
      "type": "noauth"
    },
    "method": "DELETE",
    "header": [
      {
        "key": "Authorization",
        "value": ""
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/users/:userID",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "users",
        ":userID"
      ],
      "variable": [
        {
          "key": "userID",
          "value": "<string>",
          "type": "string",
          "description": "(Required) user id"
        }
      ]
    },
    "description": "Remove user from organization. Upon sccess the user will be removed from the organization.\nRequires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope."
  },
  "response": [
    {
      "name": "Forbidden",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userID",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userID"
          ],
          "variable": [
            {
              "key": "userID"
            }
          ]
        }
      },
      "status": "Forbidden",
      "code": 403,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"meta\": {\n  \"status\": \"<integer>\",\n  \"error_message\": \"<string>\"\n }\n}"
    },
    {
      "name": "Internal Server Error",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userID",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userID"
          ],
          "variable": [
            {
              "key": "userID"
            }
          ]
        }
      },
      "status": "Internal Server Error",
      "code": 500,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"meta\": {\n  \"status\": \"<integer>\",\n  \"error_message\": \"<string>\"\n }\n}"
    },
    {
      "name": "Unauthorized",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userID",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userID"
          ],
          "variable": [
            {
              "key": "userID"
            }
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"meta\": {\n  \"status\": \"<integer>\",\n  \"error_message\": \"<string>\"\n }\n}"
    },
    {
      "name": "Not Found",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userID",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userID"
          ],
          "variable": [
            {
              "key": "userID"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"meta\": {\n  \"status\": \"<integer>\",\n  \"error_message\": \"<string>\"\n }\n}"
    },
    {
      "name": "No Content",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userID",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userID"
          ],
          "variable": [
            {
              "key": "userID"
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}