Webhooks
The webhooks API allows you to subscribe to the events in a FreJun account with your integration installed. Rather than making an API call when an event happens in a FreJun account, FreJun can send an HTTP request to an endpoint you configure.
Using the Webhook API requires the following:
FreJun app must be configured
Must have publicly available HTTPS endpoint for the callback_url that you would be configuring on subscribing to webhook events
Related Docs
Events
call.status
call.propertyChange.notes
call.propertyChange.call_reason
call.propertyChange.call_outcome
call.recording
Events
Webhook Verification
To check whether the request is from FreJun, we added a header called frejun-signature.
To verify the signature,
Create a utf-8 encoded string that concatenates together the following: requestMethod + requestUri + requestBody
Create an HMAC SHA-256 hash of the resulting string using the client secret as the secret and base64 encode the result
Compare the base64 encoded value to the signature. If they're equal then this request has been verified as originating from FreJun
Webhook verification
event | Webhook response |
call.status | { "event": "call.status", "call_id": string, "call_creator":string, "candidate_number": string, "virtual_number": string, "call_status": string, } |
call.propertyChange.notes | { "event": "call.propertyChange.notes", "call_id": string, "call_creator": string, "call_creator":string, "candidate_number": string, "virtual_number": string, "call_details": { "notes": string } } |
call.propertyChange.call_reason | { "event": "call.propertyChange.call_reason", "call_id": string, "call_creator":string, "candidate_number": string, "virtual_number": string, "call_details": { "call_reason": string } } |
call.propertyChange.call_outcome | { "event": "call.propertyChange.call_outcome", "call_id": string, "call_creator":string, "candidate_number": string, "virtual_number": string, "call_details": { "call_outcome": string } } |
call.recording | { "event": "call.propertyChange.call_reason", "call_id": string, "call_creator":string, "candidate_number": string, "virtual_number": string, "recording": url } |