Get Webhook Subscription Log
Retrieves a specific webhook subscription log by ID.
Endpoint
GET /v1/webhook-subscriptions/{webhook_subscription_id}/logs/{id}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
webhook_subscription_id | string | The ID of the webhook subscription the log belongs to. |
id | string | The ID of the webhook subscription log to retrieve. |
Response
200 OK
{
"data": {
"id": "whl_123456",
"webhook_subscription_id": "wh_123456",
"event_type": "tracking_parcel.status_changed",
"status": "success",
"url": "https://example.com/webhooks/shipping-channels",
"request_headers": {
"Content-Type": "application/json",
"X-Shipping-Channels-Event": "tracking_parcel.status_changed",
"X-Shipping-Channels-Delivery": "whl_123456",
"X-Shipping-Channels-Signature": "sha256=..."
},
"request_body": "{\"id\":\"evt_123456\",\"created_at\":\"2025-04-07T12:00:00Z\",\"type\":\"tracking_parcel.status_changed\",\"data\":{\"tracking_parcel\":{\"id\":\"tp_123456\",\"tracking_number\":\"1234567890\",\"shipping_channel_id\":\"ch_123456\",\"status\":\"delivered\",\"previous_status\":\"in_transit\",\"created_at\":\"2025-04-06T10:00:00Z\",\"updated_at\":\"2025-04-07T12:00:00Z\"}}}",
"response_status": 200,
"response_body": "{\"received\":true}",
"duration_ms": 123,
"error_message": null,
"created_at": "2025-04-07T12:00:01Z"
}
}
Error Responses
| Status Code | Description |
|---|---|
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - You don't have permission to access this webhook subscription log |
| 404 | Not Found - The specified webhook subscription log could not be found |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Something went wrong on our end |
Example Request
cURL
curl -X GET \
https://api.shipping-channels.com/v1/webhook-subscriptions/wh_123456/logs/whl_123456 \
-H "Authorization: Bearer YOUR_API_KEY"
PHP
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.shipping-channels.com/v1/webhook-subscriptions/wh_123456/logs/whl_123456', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);
JavaScript
fetch('https://api.shipping-channels.com/v1/webhook-subscriptions/wh_123456/logs/whl_123456', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Webhook Log Status
The status field in the webhook log can have the following values:
| Status | Description |
|---|---|
success | The webhook was delivered successfully (HTTP 2xx response) |
failed | The webhook delivery failed |
Failed Webhook Delivery
If a webhook delivery fails (non-2xx response, timeout, network error, etc.), the following fields provide details about the failure:
error_message: A description of the errorresponse_status: The HTTP status code returned by your server (0 if no response was received)response_body: The response body (if any) returned by your server
Retry Policy
For failed webhook deliveries, the system attempts to redeliver the webhook with the following retry schedule:
- Initial retry: 5 minutes after the first failure
- Second retry: 1 hour after the first failure
- Third retry: 6 hours after the first failure
- Final retry: 24 hours after the first failure
After all retry attempts have failed, the webhook is marked as permanently failed, and no further retry attempts are made.
Log Retention
Webhook subscription logs are retained for 30 days. After that, they are automatically deleted.