/retry_webhook
Retry a webhook event
Our recently deployed Developer Console includes the ability to reactivate a failed webhook, however that requires the developer to log into the console to fire the webhook. By using the
/retry_webhook
endpoint, developers can reactivate a failed webhook without logging into the console as long as the event is delivered successfully.
Requests
The request body at this endpoint is the header_msg
JSON object.
Authorization / Authentication
Apps using Access Token Authorization
Use a valid access token in an Authorization: Bearer request header.
See Authenticating with an Access Token for more details.
Apps using ECDSA Authentication
Only authsignature
header is required for this request.
See the section on ECDSA Authentication for more detail about ECDSA signature generation.
POST /0.2/retry_webhook HTTP/1.1
sandbox.silamoney.com
Content-Type: application/json
// if using OAuth2
Authorization: Bearer [GENERATED JWT TOKEN HERE]
// if using ECDSA
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
{
"header": {
"created": 1234567890,
"auth_handle": "handle.silamoney.eth",
"version": "0.2",
"reference": "<your unique id>"
},
"message": "header_msg",
"event_uuid": "some UUID string assigned by Sila"
}
***
HTTP/1.1 200 OK
{
"success": true,
"message": "Event successfully re-sent.",
"status": "SUCCESS",
"response_time_ms": "171",
"reference": "ca85589d-a797-4ec7-973c-7461b9aeaa3f"
}
const res = await Sila.retryWebhook(userHandle, userPrivateKey, eventUuid);
// Success Response Object
console.log(res.statusCode); // 200
console.log(res.data.status); // SUCCESS
console.log(res.data.success); // true
console.log(res.data.message); // Event successfully re-sent.
ApiResponse response= api.retryWebhooks("userHandle","event_uuid");
// Success response
System.out.println(response.getStatusCode()); // 200
BaseResponse parsedResponse = (BaseResponse) response.getData();
System.out.println(parsedResponse.getReference()); // Reference number
System.out.println(parsedResponse.getSuccess()); // true
System.out.println(parsedResponse.getStatus()); // SUCCESS
System.out.println(parsedResponse.getMessage()); // Event successfully re-sent.
$eventUuid = "55423cb9-7a9b-4d02-9517-a1c1701452e6"; // Some UUID
$response = $client->retryWebhook($eventUuid);
$this->assertEquals(200, $response->getStatusCode());
//Load your informations
string userHandle = "user.silamoney.eth";
string eventUuid = "5167160d-9d12-4fa8-a8cd-302507782de0"; //"some UUID string assigned by Sila"
ApiResponse<object> response = api.RetryWebhook(userHandle, eventUuid);
// Success Object Response
Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((BaseResponse)response.Data).Message); // "Event successfully re-sent."
Console.WriteLine(((BaseResponse)response.Data).Reference); // "ca85589d-a797-4ec7-973c-7461b9aeaa3f"
Console.WriteLine(((BaseResponse)response.Data).Success); // true
Console.WriteLine(((BaseResponse)response.Data).Status); // SUCCESS
Key | Type | Description |
---|---|---|
header | JSON object | Required. Requires these keys in JSON format: created, app_handle. See the /check_handle endpoint for the complete list of fields in this object. |
event_uuid (Webhook ID) | String | Required. Webhook Event ID. The format should be a UUID string. Example: 5167160d-9d12-4fa8-a8cd-302507782de0 |
Responses
Status Code | success Attribute | Description |
---|---|---|
200 | true | Webhook Event successfully re-sent |
400 | false | Bad request format - check validation_details for more information. |
404 | false | Webhook Event UUID does not exist. |
409 | false | Webhook Event already in progress and cannot be re-sent |
Updated 3 months ago