Skip to main content

Get Webhook Subscription Log

Retrieves a specific webhook subscription log by ID.

Endpoint

GET /v1/webhook-subscriptions/{webhook_subscription_id}/logs/{id}

Path Parameters

ParameterTypeDescription
webhook_subscription_idstringThe ID of the webhook subscription the log belongs to.
idstringThe 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 CodeDescription
401Unauthorized - Invalid or missing API key
403Forbidden - You don't have permission to access this webhook subscription log
404Not Found - The specified webhook subscription log could not be found
429Too Many Requests - Rate limit exceeded
500Server 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:

StatusDescription
successThe webhook was delivered successfully (HTTP 2xx response)
failedThe 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 error
  • response_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:

  1. Initial retry: 5 minutes after the first failure
  2. Second retry: 1 hour after the first failure
  3. Third retry: 6 hours after the first failure
  4. 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.