Skip to content

Commit

Permalink
CAS-5564/Add webhooks docs (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria Korlotian authored Jan 19, 2021
1 parent 31ea127 commit 1f4651c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Installation
Configuration
-------------

import and configure the library with your Castle API secret.
Import and configure the library with your Castle API secret.

.. code:: python
Expand Down Expand Up @@ -231,6 +231,20 @@ Exceptions
level HTTP response. You can also choose to catch a more `finegrained
error <https://github.com/castle/castle-python/blob/master/castle/errors.py>`__.

Webhooks
--------

Castle uses webhooks to notify about ``$incident.confirmed`` or `$review.opened` events.
Each webhook has ``X-Castle-Signature`` header that allows verifying webhook's source.

.. code:: python
from castle.webhooks.verify import WebhooksVerify
# Verify the webhook, passed as a Request object
WebhooksVerify.call(webhook_request)
# WebhookVerificationError is raised when the signature is not matching
Documentation
-------------

Expand Down

0 comments on commit 1f4651c

Please sign in to comment.