Back to All

Webhook url header

Hello,

in the Webhook description I see that paragraph describing the Webhook header:
Example Webhook Notification
Example webhook event (see Webhook Reference for full details):

POST /webhook-handler HTTP/1.1
Host: your-app.com
User-Agent: Samsara-Webhook/bf126598c478d8f4149f823a3651c44e3a268119
X-Samsara-Timestamp: 1587597109
X-Samsara-Signature: v1=b2d6e7f01a882a8861c2fee2fc00732dd79eaaadc67d0374b95f4bca252f2ec2
X-Samsara-Request: bf72239c-bebd-4c22-b64c-6fc692ef7c46
X-Samsara-Event-Type: Alert
Content-Type: application/json
Content-Length: 700

{
"eventId": "bf72239c-bebd-4c22-b64c-6fc692ef7c46",
"eventMs": 1587597109477,
...

and the Content-Length is included in the header. I need that information to receive correctly the message.
On the other hand, in the Webhook reference, the header does not have the Content-Length:

Payload Headers
Header Description
X-Samsara-Timestamp The Unix epoch timestamp in seconds of when the webhook notification was sent by the Samsara server. This value is also used to create the webhook signature.
X-Samsara-Signature A signature created using your webhook's secret key. This allows you to verify the notification is coming from Samsara. See Webhook Signatures for more details.
X-Samsara-Request The ID of the webhook notification. This can be helpful in debugging the issue when contacting support.
X-Samsara-Org-Id The ID of your organization. This can be helpful in debugging the issue when contacting support.
X-Samsara-Event-Type The type of webhook notification. See the Payload Body section for more details.
User-Agent Value is always Samsara-Webhook/ followed by an opaque string. This should not be used to verify the request is coming from Samsara, as it can be easily spoofed. Instead, use the signature which is signed with your secret key.
Content-Type Value is always application/json.

Is it possible to add the item Content-Length to the header?
I made some tests with Postman and without that item, I receive an error "400 Bad Request"

Thank you very much,
Pierre