Chilkat Online Tools

DataFlex / Squadcast API V3 / Remove User

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vResp
    Handle hoResp
    Integer iRespStatusCode
    String sTemp1
    Boolean bTemp1

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Send ComSetRequestHeader To hoHttp "Authorization" ""

    Get ComQuickRequest Of hoHttp "DELETE" "https://api.squadcast.com/v3/users/:userID" To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStatusCode Of hoResp To iRespStatusCode
    Showln "Response Status Code = " iRespStatusCode
    If (iRespStatusCode <> 204) Begin
        Showln "Response Header:"
        Get ComHeader Of hoResp To sTemp1
        Showln sTemp1
        Showln "Response Body:"
        Get ComBodyStr Of hoResp To sTemp1
        Showln sTemp1
        Showln "Failed."
        Send Destroy of hoResp
        Procedure_Return
    End

    Send Destroy of hoResp
    Showln "Success."


End_Procedure

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": ""
    }
  ]
}