2

I am trying to configure Change Data Capture for the ChangeEvents channel via the REST API as you can in Setup Change Data Capture when using the Salesforce UI.

I am able to add records of PlatformEventChannelMember via a REST POST call: /services/data/v50.0/tooling/sobjects/PlatformEventChannelMember. The current documentation is clear on the payload required.

The documentation indicates that REST DELETE is available for PlatformEventChannelMember, but I haven't had success using it. I couldn't find an example or documentation for the payload. I made an attempt using the same payload as had succeeded for POST. This results in a 405 error. HTTP Method 'DELETE' not allowed. DELETE is documented as available for the endpoint.

I also attempted to use DELETE with both the /services/data/v50.0/sobjects/{{ObjectId}} and /services/data/v50.0/tooling/sobjects/{{ObjectId}} REST paths unsuccessfully. Though the object id is easily queried via SOQL using the tooling API. Both return a 404 The requested resource does not exist error. The provided {{ObjectId}} was returned by both the successful POST on PlatformEventChannelMember, and by a tooling API Soql query:

SELECT Id FROM PlatformEventChannelMember WHERE SelectedEntity = 'DeleteableGrommet__c'

1 Answer 1

1

Salesforce APIs aren't very self-consistent, and the documentation is incomplete, but just by trial and error, I found this to work flawlessly:

DELETE on /services/data/v51.0/tooling/sobjects/PlatformEventChannelMember/{{ObjectId}}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .