Skip to content

Rehket/SFWebhooks

Repository files navigation

SF Webhooks

Some classes to create outbound JSON webhooks.

TO DO:

  • Tests...💥👍💪
  • Maybe improve logging. 📑
  • Permission sets❓
  • UI/LWC app to create and monitor the webhooks? 📈
  • Setup immediate mode/synchronous execution?❔❓

Deployment

  1. Pull the repo from github.

  2. Deploy to your org.

  3. Figure out the object permissions.

  4. Insert a Webhook__c.

    Account my_account = [SELECT Id, Name FROM Account LIMIT 1];
    Webhook__c foo = new Webhook__c(
        URL__c = 'https://your_url_here.com',
        // Headers__c = '{"Content-Type": "application/json"}', <-- Headers can be optionally specified!
        Payload__c = JSON.serialize(my_account)
        // Object_Payload_Id__c = my_account.Id  <-- This will send all fields available to user!
    );
    
    insert foo;
  5. Get the result:

    {
        "webhook_id": "a023l00000kvpfUAAQ",
        "timestampz": "2019-08-15T19:35:48.134-07:00",
        "queued_timestampz": "2019-08-15T19:35:46.000-07:00",
        "payload": {
            "attributes": {
                "type": "Account",
                "url": "/services/data/v46.0/sobjects/Account/0011N00001E6asMQAR"
            },
            "Id": "0011N00001E6asMQAR",
            "Name": "A great company"
        },
        "instance_url": "https://your_org_here.my.salesforce.com"
    }
    

About

JSON Outbound Webhooks for SFDC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages