Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dropbox Webhooks

Dropbox Webhooks

Webhooks are a way for web apps to get real-time notifications when users' files change in Dropbox.

This presentation is a brief overview of Dropbox webhooks. Learn more here: https://www.dropbox.com/developers/webhooks/tutorial.

Steve Marx

May 21, 2014
Tweet

More Decks by Steve Marx

Other Decks in Technology

Transcript

  1. Dropbox Webhooks
    or “Don’t call me. I’ll call you.”
    Steve Marx
    @smarx
    [email protected]

    View Slide

  2. Polling

    View Slide

  3. Long-polling

    View Slide

  4. Long-polling with
    multiple users

    View Slide

  5. Webhooks!

    View Slide

  6. Adding a webhook

    View Slide

  7. The verification request
    GET webhooksdemo.webscript.io/?challenge=abc123 HTTP/1.1
    User-Agent: DropboxWebhooks/1.0
    ---
    HTTP/1.1 200
    Content-Length: 6
    abc123

    View Slide

  8. A notification request
    POST webhooksdemo.webscript.io/ HTTP/1.1
    User-Agent: DropboxWebhooks/1.0
    X-Dropbox-Signature: 938f38e2b76dc0e69cfd7ea0735d251567…
    Content-Type: application/json
    {"delta": {"users": [12345678]}}
    ---
    HTTP/1.1 200
    Content-Length: 0

    View Slide

  9. A notification request
    POST webhooksdemo.webscript.io/ HTTP/1.1
    User-Agent: DropboxWebhooks/1.0
    X-Dropbox-Signature: 938f38e2b76dc0e69cfd7ea0735d251567…
    Content-Type: application/json
    {"delta": {"users": [12345678]}}
    ---
    HTTP/1.1 200
    Content-Length: 0
    HEX(HMAC_SHA256(app_secret, request_body))

    View Slide

  10. Let’s see some code!

    View Slide

  11. View Slide

  12. View Slide

  13. View Slide

  14. View Slide

  15. Eat, drink, and use webhooks.

    View Slide