Chilkat Online Tools

VB.NET / Sunshine Conversations API / Delete Webhook

Back to Collection Items

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

Dim http As New Chilkat.Http
Dim success As Boolean

http.BasicAuth = True
http.Login = "username"
http.Password = "password"


Dim resp As Chilkat.HttpResponse = http.QuickRequest("DELETE","https://domain.com/v2/apps/{{appId}}/integrations/:integrationId/webhooks/:webhookId")
If (http.LastMethodSuccess = False) Then
    Debug.WriteLine(http.LastErrorText)
    Exit Sub
End If


Dim sbResponseBody As New Chilkat.StringBuilder
resp.GetBodySb(sbResponseBody)

Dim jResp As New Chilkat.JsonObject
jResp.LoadSb(sbResponseBody)
jResp.EmitCompact = False

Debug.WriteLine("Response Body:")
Debug.WriteLine(jResp.Emit())

Dim respStatusCode As Integer = resp.StatusCode
Debug.WriteLine("Response Status Code = " & respStatusCode)
If (respStatusCode >= 400) Then
    Debug.WriteLine("Response Header:")
    Debug.WriteLine(resp.Header)
    Debug.WriteLine("Failed.")

    Exit Sub
End If


Curl Command

curl -X DELETE
	-u 'username:password'
https://domain.com/v2/apps/{{appId}}/integrations/:integrationId/webhooks/:webhookId

Postman Collection Item JSON

{
  "name": "Delete Webhook",
  "_postman_id": "9306f26d-faff-4c2a-a67d-dce45d21e284",
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{url}}/v2/apps/{{appId}}/integrations/:integrationId/webhooks/:webhookId",
      "host": [
        "{{url}}"
      ],
      "path": [
        "v2",
        "apps",
        "{{appId}}",
        "integrations",
        ":integrationId",
        "webhooks",
        ":webhookId"
      ],
      "variable": [
        {
          "key": "integrationId"
        },
        {
          "key": "webhookId"
        }
      ]
    },
    "description": "Deletes the specified webhook associated with a Sunshine Conversations Connect integration or a custom integration."
  },
  "response": [
    {
      "id": "a14e6d0c-c661-4a00-84ad-4d0ed2b9b01b",
      "name": "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/integrations/:integrationId/webhooks/:webhookId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v2",
            "apps",
            ":appId",
            "integrations",
            ":integrationId",
            "webhooks",
            ":webhookId"
          ],
          "variable": [
            {
              "key": "appId"
            },
            {
              "key": "integrationId"
            },
            {
              "key": "webhookId"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "id": "bf53cfa2-6411-4fc6-a58e-b264d115d61c",
      "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/integrations/:integrationId/webhooks/:webhookId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v2",
            "apps",
            ":appId",
            "integrations",
            ":integrationId",
            "webhooks",
            ":webhookId"
          ],
          "variable": [
            {
              "key": "appId"
            },
            {
              "key": "integrationId"
            },
            {
              "key": "webhookId"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{}"
    }
  ]
}