Expand Settings. Once your settings are expanded, there is field named
Webhook URL. Fill in this field with the endpoint that you'd like Voltage to make a request to. While you're in the settings you should also note down the field labeled
Webhook Secretas this will be used to validate the request.
POSTrequest to your webhook endpoint. This request will include a JSON payload with details about the event. This request will also include a header named
VOLTAGE_SECRETwhich will contain your webhook secret. When receiving the webhook event, you should parse the fields and take appropriate action.
VOLTAGE_SECRETheader and the
"api"field in the JSON payload. This will help you ensure that the request was made from Voltage and you are sending requests to a node or endpoint that you trust.
typefield is used to specify what type of event it was. The current options are
detailsfield will include specific details about the event based on the what Type the event is.
Expand Settings. Then find the
Webhook URLfield and paste in your webhook endpoint. Also take note of your
Webhook Secret. Save your settings.
waiting_unlockstatus event. When a request comes in, you should first check the
VOLTAGE_SECRETheader to ensure it matches what you expect. Second, you should validate the
apifield in the JSON payload to ensure it's what you expect. If their of these are not what you're expecting you should stop processing the event.
typefield. If the
statusthen you can proceed to check the
details.statusfield. If the
waiting_unlockthen you can continue processing the event and unlock your node.
/v1/unlockwalletAPI. This takes a
POSTrequest with a JSON payload containing 2 fields.
stateless_init. You're password must be base64 encoded and
true. Here's an example of what it would look like with