A project web hook is a URL that will be executed when a session is created, updated or deleted. Each project can be configured with a project web hook which can be enabled/disabled at any time, either via the Project Options page or via the API.
Returns the web hook configuration for a project.
{ "status": "success", "message": "success", "result": { "client_id": 19817472, "project_id": 1249918, "endpoint": "example.com/web_hook", "enable_http_authorization": false, "enable_web_hook": true } }
Param name | Description |
---|---|
project_id required |
The ID of the project. Validations:
|
Creates a new web hook configuration for a project or updates the existing configuration.
Example Response: { "status": "success", "message": "success", "result": { "client_id": 19817472, "project_id": 1249918, "endpoint": "example.com/web_hook", "enable_http_authorization": false, "enable_web_hook": true, "customer_parameters": { "key 1": "value 1", "key 2": "value 2", "key 3": "value 3", } } }
Param name | Description |
---|---|
project_id required |
The ID of the project. Validations:
|
endpoint optional |
The URL to execute when this web hook is triggered. The HTTPS protocol is automatically enforced to increase security and the endpoint URL should not contain the protocol. Validations:
|
enable_web_hook optional |
Enables or disables the web hook. Can be “true” (enabled) or “false” (disabled). Validations:
|
enable_http_authorization optional |
Enables or disables using HTTP Authorization header with the web hook. Can be “true” (enabled) or “false” (disabled). Validations:
|
http_authorization_value optional |
The value to be added to the HTTP Authorization header when the web hook is executed. This value cannot be retrieved once set. This value can be set to basic authentication, token authentication or other HTTP Authorization values in order to authorize the web hook event for the executed endpoint. Validations:
|
custom_parameters optional |
A dictionary of key-pair values that will be added to the web hook POST request. Validations:
|
Removes the web hook configuration for a project.
{ "status": "success", "message": "success", "result": "deleted" }
Param name | Description |
---|---|
project_id required |
The ID of the project. Validations:
|
Tests the project’s web hook configuration by sending a POST request to the endpoint with a test payload. The test payload will be sent with the session.test
event type and a null session_id
.
The request will return a Web Hook Event that is created to process the request.
Example of the POST parameters that are sent to the endpoint. { "client_id": 19817472, "project_id": 1249918, "session_id": null, "event_type": "session.test", "event_timestamp": 1512624088.977, "custom parameter key 1": "custom parameter value 1", "custom parameter key 2": "custom parameter value 2", "custom parameter key 3": "custom parameter value 3", "ssl_version": 1.2 }
Example response from triggering the test event. Polling can be used to re-request this event until the processing is complete which can be determined by waiting for the response_code and response_message to be populated. { "status": "success", "message": "success", "result": { "id": EVENT_ID, "client_id": 19817472, "project_id": 1249918, "session_id": null, "event_type": "session.test", "event_timestamp": 1512624088.977, "response_code": null, "response_message": null } }
Param name | Description |
---|---|
project_id required |
The ID of the project. Validations:
|