post https://sandbox.api.mothership.com/beta/webhookConfigs
This endpoint allows a user to create a webhook config for his/her shipper account.
Consult the Webhooks section of Mothership's API Documentation for details about available event subscriptions.
The SHA256 signature of each payload can be found in the X-Mothership-Signature
header of the webhook POST request and verified using the secretKey
available on the Create Webhook Config response body. See Validating webhooks webhooks for more information.
curl -X POST \
https://sandbox.api.mothership.com/beta/webhookConfig \
-H 'Authorization: Bearer {YOUR_API_TOKEN}' \
-H 'Content-Type: application/json' \
-d '{
"webhookUrl": "https://www.yourserver.com/webhook/mothership",
"subscribedEvents": ["shipment.purchased", "billOfLading.created",
"proofOfDelivery.created"]
}'
{
"data": {
"id": "48asjgaoi33nkl4t3lae",
"createdAt": "2019-03-20T16:17:13:424Z",
"status": "active",
"subscribedEvents": ["shipment.purchased", "billOfLading.created", "proofOfDelivery.created"],
"webhookUrl": "https://www.yourserver.io/webhook/mothership",
"secretKey": "de3ADDAek3245DLAdANe91Dn3asklAMSsna03aGKkl23agsJea"
}
}