Learn how to integrate your application with OPENFORMAT’s webhook system to receive real-time notifications for specific events.
transaction
: This event is triggered whenever one of your transactions is broadcasted in the blockchain. The payload for this event is the transaction receipt as created by the ehters.js library.event
: A string with the event that triggered the call.idempotency_key
: A string that contains an idempotency key for the webhook call. You should ignore this call if your application already processed a call with the same key.payload
: A JSON object which will hold the relevant data for the triggered event.transaction
event:
POST /api/v1/webhook
and passing:
url
: the HTTPS url of your webhook.events
: the list of events that will trigger the webhook call. If this parameter is not sent all events will be used as triggers.POST /api/v1/webhook/:id/test
where :id
is the id of the webhook to verify, example /api/v1/webhook/12/test
.
This action will trigger a webhook call that needs to be responded correctly. The call will contain the following fields:
event
: With value test
.idempotency_key
: With an idempotency key for this call.payload
: With value null
x-openformat-signature
header with a valid signature.
Example verification request:
application/json
.challenge
. This field will contain the value of the x-openformat-signature
in the webhook call request.GET /api/v1/webhook/secret
exists to retrieve the current webhook secret associated with the user account. This endpoint returns the current secret in the response.
POST /api/v1/webhook/secret
exists to generate a new secret. This request has no body, and the secret is generated by the system and returned in the response. The new secret replaces the previous one associated with the user account.
x-openformat-signature
header. All webhook calls executed by the OPENFORMAT API contain this header.{
character and ends with a }
character, inclusive.base64
format.x-openformat-signature
header.f2ec0291-cf11-41ec-b9b6-bfaa218c745b
.
Then we have:
BASE64( HMAC-256( body, secret ) )
In Python we could solve it this way:
x-openformat-signature
header.
GET /api/v1/webhook/:id/logs
you can get the logs for calls executed for a specific webhook. In this URL :id
is the identification of the webhook, example 123
.
page
and page_size
.