Test webhook endpoint
Shipping services
Test webhook endpoint
Send a test webhook notification to verify your endpoint is working correctly.
Overview
This endpoint allows you to test your webhook implementation by sending a sample webhook payload to your registered endpoints. This is useful for:
- Verifying your webhook handler is working correctly
- Testing signature verification
- Debugging webhook processing logic
- Ensuring your endpoint can handle the expected payload structure
How it works
- Provide shipment IDs - Specify which shipments to use for the test
- Send test webhooks - Teleship sends test notifications to all your enabled webhooks
- Verify results - Check the response to see which webhooks were notified successfully
Test Payload
The test webhook will send a shipment.updated event with real shipment data, allowing you to test with actual data structure.
Response
The response includes:
- Overall success status
- Number of webhooks notified
- Detailed results for each shipment
- Any errors that occurred during testing
Example Usage
curl -X POST "https://api.teleship.com/api/webhooks/test" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"shipmentIds": ["ship_123", "ship_456"]
}'
Example Response
{
"success": true,
"message": "Successfully tested webhooks for 2/2 shipments",
"webhooksNotified": 4,
"results": [
{
"shipmentId": "ship_123",
"success": true,
"message": "Test webhook sent successfully to 2 webhook(s)",
"webhooksNotified": 2
},
{
"shipmentId": "ship_456",
"success": true,
"message": "Test webhook sent successfully to 2 webhook(s)",
"webhooksNotified": 2
}
]
}
Troubleshooting
If webhook tests fail:
- Check endpoint URL - Ensure your webhook endpoint is accessible
- Verify signature handling - Make sure your signature verification is working
- Check response time - Ensure your endpoint responds within 30 seconds
- Review logs - Check your webhook handler logs for errors
- Test manually - Use tools like ngrok to test locally during development
POST
Test webhook endpoint
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Array of shipment IDs to test webhook notifications for
Example: