Duda can notify your app about events that are not part of the app lifecycle. Therefore the behavior of the Duda platform is not affected by the response of the webhook endpoint. Your endpoint should return a 200 HTTP response for successful calls to allow Duda to monitor requests.

πŸ“˜

We Sign Webhooks!

You can use the same method outlined in Lifecycle Events to verify the authenticity of the webhook and it's sender.

Webhooks

The Duda App Store allows apps to register to webhooks. Webhooks allow the app to be informed about events happening outside the app integration context, such as publishing the site or updating the Duda reseller branding.
Part of the webhooks are available to Duda's users, see the public webhooks documentation. The other part is webhooks available only to apps, listed below.

Register to Webhooks

To register to webhooks, update your apps' manifest with the webhooks object:

"webhooks": {
    "endpoint": "https://example.com/endpoint",
    "events": [
      "PUBLISH"
    ]
  }

Where endpoint is the target URL and events is the list of events you want to register to.
Note that registering to webhooks requires sufficient scopes.

Webhooks reference

For the general structure of webhooks sent by Duda see the public webhooks documentation.
The following reference describes the webhooks available for apps.

Contact form sent

🚧

Version differences

Note that this webhook format is not the same as the current public webhook. Updating the version is under development.

{
   "data":[
      {
         "field_label":"Name",
         "field_value":"John",
         "field_type":"text",
         "field_key":"",
         "field_id":"dmform-00"
      },
      {
         "field_label":"Email",
         "field_value":"[email protected]",
         "field_type":"email",
         "field_key":"",
         "field_id":"dmform-01"
      },
      {
         "field_label":"Phone",
         "field_value":"5555555555",
         "field_type":"tel",
         "field_key":"",
         "field_id":"dmform-02"
      },
      {
         "field_label":"What services do you need?",
         "field_value":"Option 1",
         "field_type":"dropdown",
         "field_key":"",
         "field_id":"dmform-03"
      },
      {
         "field_label":"Title",
         "field_value":"Contact Us",
         "field_type":"form_title",
         "field_key":"",
         "field_id":null
      }
   ],
   "source":null,
   "resource_data":{
      "site_name":"1501ccca016a4220861ef07fe2c8eb0d"
   },
   "event_timestamp":1565789644948,
   "event_type":"CONTACT_FORM_SENT"
}

Site restored

{
   "data":null,
   "source":{
      "type":"EDITOR",
      "account_name":"[email protected]"
   },
   "resource_data":{
      "site_name":"1501ccca016a4220861ef07fe2c8eb0d"
   },
   "event_timestamp":1565789782454,
   "event_type":"SITE_RESTORED"
}

Content library updated

{
   "data":{
      "location_data":{
         "phones":[
            {
               "phoneNumber":"54564645",
               "label":""
            }
         ],
         "emails":[
            {
               "emailAddress":"[email protected]",
               "label":"John Smith"
            }
         ],
         "label":"HQ",
         "social_accounts":{

         },
         "address":{

         },
         "address_geolocation":"Piccadilly Circus, London, United Kingdom",
         "geo":{
            "longitude":"-0.13511",
            "latitude":"51.51008"
         },
         "logo_url":null,
         "business_hours":[

         ]
      },
      "additional_locations":[

      ],
      "site_texts":{
         "overview":"",
         "services":"",
         "custom":[

         ],
         "about_us":""
      },
      "business_data":{
         "name":null,
         "logo_url":null
      },
      "site_images":[

      ]
   },
   "source":{
      "type":"EDITOR",
      "account_name":"[email protected]"
   },
   "resource_data":{
      "site_name":"1501ccca016a4220861ef07fe2c8eb0d"
   },
   "event_timestamp":1565789980695,
   "event_type":"CONTENT_LIB_CHANGED"
}

Content library published

This event is the counterpart of the content library publish API.

{
   "data":{
      "location_data":{
         "phones":[
            {
               "phoneNumber":"54564645",
               "label":""
            }
         ],
         "emails":[
            {
               "emailAddress":"[email protected]",
               "label":"John Smith"
            }
         ],
         "label":"HQ",
         "social_accounts":{

         },
         "address":{

         },
         "address_geolocation":"Piccadilly Circus, London, United Kingdom",
         "geo":{
            "longitude":"-0.13511",
            "latitude":"51.51008"
         },
         "logo_url":null,
         "business_hours":[

         ]
      },
      "additional_locations":[

      ],
      "site_texts":{
         "overview":"",
         "services":"",
         "custom":[

         ],
         "about_us":""
      },
      "business_data":{
         "name":null,
         "logo_url":null
      },
      "site_images":[

      ]
   },
   "source":{
      "type":"API"
   },
   "resource_data":{
      "site_name":"1501ccca016a4220861ef07fe2c8eb0d"
   },
   "event_timestamp":1565790284129,
   "event_type":"CONTENT_LIB_PUBLISHED"
}