Webhooks
Truvera allows you to register a webhook for asynchronous integration with the API. When the below listed events occur within the API, the event will be published to the registered webhook URLs that are configured to receive the notification. You also need to select at least one of the webhook events from Truvera Workspace to trigger the data exchange.
The webhook response will confirm that an event occurred and provide key information about the event including the relevant resource identifier. Additional information can be obtained by querying the appropriate endpoint for that resource to receive additional details. This pattern helps minimize the data that would be seen by a 3rd party webhook provider.
Step-by-step
Start by getting your flow working with polling. That will allow you to troubleshoot your usage of the Truvera API.
Then configure your webhook receiver as appropriate for your deployment environment.
Next, configure the webhook in Truvera by following these steps:
Go to Webhooks in Truvera Workspace.
Click Add Endpoint.
Fill in the Endpoint URL and select Endpoint Events for the webhook events.
Click Create Webhook.
Once the webhook is created you will see a secret token. This token is sent in the webook POST request for you to validate that the webhook came from Truvera.
You can subscribe to all events by clicking Receive All next to Endpoint Events.
When the webhook triggers, your code should first validate the secret token.
Then check the "event" attribute of the payload to determine the type of event that occurred.
For many events, all the information you need to complete your workflow is contained in the payload. If additional information is needed, you should call the appropriate API endpoint using the same process as is used when polling.
Webhook events
You can configure the following events to trigger the HTTP request to send the data to your application.
credential_create
This event indicates a credential has been created. It will fire when a credential has been created.
credential_issued
This event indicates a credential has been issued. It will fire when a credential has been issued.
credential_revoke
This event indicates a credential has been revoked. It will fire when a credential has been revoked.
credential_unrevoke
This event indicates a credential has been unrevoked. It will fire when a credential has been unrevoked.
did_create
This event indicates a DID has been created. It will fire when a DID has been created.
did_update_key
This event indicates a keyType value within the DID has been updated. It will fire when the keyType value has been updated.
did_update_controller
This event indicates a controller value within the DID has been updated. It will fire when the controller value has been updated.
When you update both controller and keyType, you will receive did_update_controller event notification too on your webhook since updating controller value will update the keyType value.
did_delete
This event indicates a DID has been deleted. It will fire when a DID has been deleted.
registry_create
This event indicates a registry has been created. It will fire when a registry has been created.
registry_delete
This event indicates a registry has been deleted. It will fire when a registry has been deleted.
schema_create
This event indicates a schema has been created. It will fire when a schema has been created.
proof_submitted
This event indicates that a proof has been submitted. Minimal data is included in the event but the details can be retrieved using the proof_request API.
Last updated
Was this helpful?