Webhooks gives you a way of knowing when an event related to one of your jobs has happened.
E.g. when a song is mastered successfully.
There is no limit to how many webhooks you can have.
Example: Webhook POST request body from Masterchannel
{
'file_ref': 'd2b00fd2-7837-44a8-b1b4-1dcbda5998b2',
'event': 'MASTER_COMPLETED',
'estimated_completion_date': '2022-09-15T12:36:19Z',
'completion_date': '2022-09-15T12:35:42Z'
}
Validating a Webhook call (optional)
All webhook calls coming from Masterchannel to your assigned webhook.url
will have x-signature
in it's header. If the computed hash (HMAC/SHA-256) of the webhook_call.body
using the secret key from webhook.secret
equals the value of the webhook_call.header['x-signature']
, then you can be assured that the webhook call came from Masterchannel!
Example:
// The secret attached to your webhook, retrievable by our endpoints
var secret = webhook.secret;
// The request our backend sent your URL, e.g. when a song was successfully mastered
var body = webhook_call.body();
if(hmac(body, secret) == webhook_call.headers["x-signature"]){
// The request is valid
} else {
// The request is invalid
}