Chilkat Online Tools

Ruby / Salesforce Platform APIs / Delete Subscription

Back to Collection Items

require 'chilkat'

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

http = Chilkat::CkHttp.new()

# Adds the "Authorization: Bearer <access_token>" header.
http.put_AuthToken("<access_token>")

# resp is a CkHttpResponse
resp = http.QuickRequest("DELETE","https://domain.com/services/data/v{{version}}/chatter/subscriptions/:SUBSCRIPTION_ID")
if (http.get_LastMethodSuccess() == false)
    print http.lastErrorText() + "\n";
    exit
end

print resp.get_StatusCode().to_s() + "\n";
print resp.bodyStr() + "\n";

Curl Command

curl -X DELETE
	-H "Authorization: Bearer <access_token>"
https://domain.com/services/data/v{{version}}/chatter/subscriptions/:SUBSCRIPTION_ID

Postman Collection Item JSON

{
  "name": "Delete Subscription",
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "exec": [
          ""
        ],
        "type": "text/javascript"
      }
    },
    {
      "listen": "test",
      "script": {
        "exec": [
          ""
        ],
        "type": "text/javascript"
      }
    }
  ],
  "protocolProfileBehavior": {
    "disabledSystemHeaders": {}
  },
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{_endpoint}}/services/data/v{{version}}/chatter/subscriptions/:SUBSCRIPTION_ID",
      "host": [
        "{{_endpoint}}"
      ],
      "path": [
        "services",
        "data",
        "v{{version}}",
        "chatter",
        "subscriptions",
        ":SUBSCRIPTION_ID"
      ],
      "variable": [
        {
          "key": "SUBSCRIPTION_ID",
          "value": "0E8..."
        }
      ]
    },
    "description": "Information about the specified subscription. Also used to delete a subscription, for example, to unfollow a record or a topic.\nA subscription ID is returned as part of the response body for follower and following resources, for example, /records/recordId/followers. In addition, subscriptions IDs are also returned in many summary response bodies, such as group summary or user summary.\n\nhttps://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_subscriptions.htm"
  },
  "response": [
    {
      "name": "Delete Subscription",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{_endpoint}}/services/data/v{{version}}/chatter/subscriptions/:SUBSCRIPTION_ID",
          "host": [
            "{{_endpoint}}"
          ],
          "path": [
            "services",
            "data",
            "v{{version}}",
            "chatter",
            "subscriptions",
            ":SUBSCRIPTION_ID"
          ],
          "variable": [
            {
              "key": "SUBSCRIPTION_ID",
              "value": "0E8..."
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "plain",
      "header": [
        {
          "key": "Date",
          "value": "Wed, 22 Nov 2023 11:34:47 GMT"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=63072000; includeSubDomains"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "Content-Security-Policy",
          "value": "upgrade-insecure-requests"
        },
        {
          "key": "X-Robots-Tag",
          "value": "none"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache,must-revalidate,max-age=0,no-store,private"
        }
      ],
      "cookie": [
      ],
      "body": null
    }
  ]
}