The webhook posts data to the URL you provided in the configuration. The body is encoded in JSON, which is indicated by the application/json content-type, with UTF-8 encoding (as stated in RFC 4627 (http://www.ietf.org/rfc/rfc4627.txt).
HrFlow can send different events types to your application. Each call to the webhook URL will send an array of payloads.
PAYLOAD | EVENT | STATUS | TYPE | DESCRIPTION | VOLUME |
profile | parsing |
|
| Notification of the profile parsing status. | High volume |
profile | embedding |
|
| Notification of the profile embedding status. | High volume |
job | parsing |
|
| Notification of the job parsing status. | High volume |
job | embedding |
|
| Notification of the job embedding status. | High volume |
action | stage |
|
| Notification of action stage status. | Low volume |
Handling an event is very simple. You can specify callback function to handle every event incoming on your webhooks endpoint. Each event must have its own handling function.
Requirements
The request header
The API secret key
The webhook secret key
An endpoint receiving post requests
Examples :
import hrflow as hf​def func_callback(event_name, webhook_data):print("{} {}".format(event_name, webhook_data)​client = hf.Client(api_secret='api_secret', webhook_secret='webhook_key')​# Set an handler for webhook event.callback = func_callbackresp = client.webhooks.setHandler('profile.parsing.success', callback)# Get the header of the request sent by the webhook.rcvheaders = function_that_get_webhook_request_headers()# Handle the webhookclient.webhooks.handle(request_headers=rcvheaders)