0
curl --location --request PUT 'https://ap17.salesforce.com/services/data/v48.0/sobjects/ApexTrigger/01q2x000000YiNcAAK' \
--header 'Authorization: Bearer 00D2....' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Name": "ContactCreateUpdateDeleteApexTrigger",
    "TableEnumOrId": "Contact",
    "Body":"trigger ContactCreateUpdateDeleteApexTrigger on Contact (after update,after insert, after delete) {            String url = '\''https:endpoint.com'\'';         String content = WebhookClass.jsonContent(Trigger.new, Trigger.old,'\''Contact'\'');         WebhookClass.callout(url, content);          }"
    }'

I am getting 200 Response but my triggers are not updated.

1 Answers1

0

Apex class, Apex trigger tables are visible just for reference purposes and backups. What you do is not a simple data manipulation operation, it has to be a proper deployment with compilation, running unit tests, min 75% code coverage... Especially that your endpoint looks like a production.

Check the Tooling API, it's also RESTful. This should be a nice start: https://salesforce.stackexchange.com/q/156221

eyescream
  • 18,088
  • 2
  • 34
  • 46