Connect a webhook URL, and Medialister sends an event to your server each time an order needs your action. You do not have to poll.
An event holds only the event type and the order status. To learn what changed, request the order through the API.
The Integrations page appears only for organization admins, and only after Medialister has turned webhooks on for your organization. If you do not see it, contact support.
How to Connect a Webhook URL
Ask your Medialister manager or [email protected] to turn webhooks on for your organization.
Prepare a URL on your server with a valid certificate. See "What Must Your Server Do".
In the dashboard, open the account menu and choose `Settings`. Under Organization Settings, choose `Integrations`.
Enter the URL in the `Webhook URL` field, for example `https://yourdomain.com/webhooks`.
Click `Connect`. Medialister sends a test request (a ping) to the URL.
When the test succeeds, the field shows "URL verified" with the date and time, and the button changes to Disconnect. When the test fails, the URL is not saved and the field shows what your server answered.
What Must Your Server Do
Accept
POSTrequests with a JSON body.Answer the ping with a 2xx status and the plain-text body
pong.Answer each other event with a 2xx status in 10 seconds or less. Answer first and do the work after.
Check the signature of each event, but not of the ping.
Which Events Are There
All events are about orders. There are three event types:
Event | What it tells you |
|---|---|
| A new order needs your action. |
| An order changed. The reason in the event tells you what happened. |
| The test request that is sent when you connect the URL. |
Each link opens the event in the API reference, with its reasons and fields. Events are sent only for actions of the other side or of Medialister, never for your own actions. For publishers, the same events are in the Publisher API reference.
How to Check That an Event Is from Medialister
Each endpoint has a signing secret that starts with whsec_. The secret is shown one time only, when the URL is first registered. Keep it on your server. If you do not have it, get a new one with the rotate-secret route in the API reference. The old secret stops working at once.
Each request carries three headers:
Medialister-Signature: a timestamp and an HMAC SHA-256 signature of the body.Medialister-Event-Id: the ID of the event. It is the same on each retry.Medialister-Event-Type: the event type.
Reject a request with a wrong signature or with a timestamp that is more than 5 minutes old. The ping at setup is the one exception: it is signed with the new secret before you have it. The code sample is in the reference.
How Do Delivery and Retries Work
A 2xx answer in 10 seconds or less confirms the delivery, and the event is not sent again. Each other answer, a timeout and a redirect cause a retry.
Attempt | Sent |
|---|---|
1 | At once |
2 to 6 | After 1, 3, 9, 27 and 81 minutes |
7 | After about 4 hours |
8 and 9 | After 6 hours each |
That is 9 attempts in about 18 hours. If the last one fails, the event is marked as failed. A retry sends the same body with the same event ID.
How to Disconnect or Change the URL
Click Disconnect to turn event delivery off. The field becomes editable again, so you can enter a different URL and click Connect.
Your developers can also change the URL, pause the delivery and get a new signing secret through the API. The routes are in the API reference.
Troubleshooting
Problem | What to check |
|---|---|
There is no | You are not an admin of the organization, or webhooks are not turned on for it. Contact support. |
| Your server must answer the ping with a 2xx status and the body |
No events arrive | Check that the URL is connected and shows "URL verified". Events are sent only for actions of the other side or of Medialister. Your own actions send no event. |
The same event arrives two times | Your server did not answer with a 2xx status in 10 seconds, so Medialister sent the event again. Make the server answer first and do the work after. Ignore an event with an event ID that you already processed. |
The signature check fails | Use the raw request body, the current secret and the timestamp from the header. Do not check the signature of the ping. |
Notes
Each organization has one webhook URL per side. The
Integrationspage manages the URL of the side that you have open: the client URL in the client dashboard, the publisher URL in the publisher dashboard.An endpoint cannot be deleted. To stop the events, disconnect it.
Need Help?
Write to [email protected]. Give the event ID and the time of the request.