How to receive Real-time event notification
Let’s imagine a User is created through your Directory Sync. Maybe you want to be kept informed of this information. For this you can create a webhook
as follows:
- Dashboard
- API
- First access your dashboard.
- Once logged in, in the left sidebar, click on the
Webhooks
button for which you wish to activate SSO. - Then, click on the
New Webhook
button at the top right of your screen. - Fill all the necessary information and select the events you wish to listen to.
- Save.
curl -X POST 'https://${cryptr_service_url}/api/v2/webhooks' \
-d 'name=webhook-name' \
-d 'target_url=https://your_target_url.fr' \
-d 'event_codes[]=all'
Let's look at this in more detail.
First you must enter a name
to differentiate your webhooks, the environment for which you wish to listen to events and a list of events
.
Here we want to listen to a Directory Sync User Creation so we can put dir_sync.user.provision.success
or all
as one of the value of the key event_codes
. There are other event codes. If you want to know more you can consult the guide about Webhooks.
Finally you must specify the URL
on which you want to receive the events that the Webhook will send you.
Now that you have created a webhook, if your
events
associated with the event_codes
you have chosen.If you want to know more about it, you can consult our detailed documentation on the page dedicated to Webhooks or our official guide.
See also
- Events list: The list of events used by Cryptr