Webhooks
Note
We recommend using Automation Rules instead of Webhooks, as Automation Rules supports V2 actions and provides the same functionality as Webhooks.
In complex systems, you may want to provide additional event handling on your custom server. To achieve this, PlayFab offers Webhooks.
Whenever a new event is emitted, it can be forwarded to your server by making a POST request to your custom web endpoint. The event data is then passed as the JSON body of the request.
Important
Entity PlayStream Events will not support forwarding with Webhooks.
Accessing Webhooks
To access the Webhooks panel in the PlayFab Game Manager screen:
- Select Data in the sidebar menu.
- Then choose the Webhooks tab.
Overview of the Webhooks panel
The image shown below provides an overview of the Webhooks panel.
- The New Webhook button allows you to create and configure a new Webhook.
- The Webhook Name area can be used to access and configure the Webhook.
- The Status area shows whether a Webhook is currently enabled.
- The Failing Since area shows when a Webhook endpoint stopped returning OK responses.
- When one or more Webhooks are selected, you can use the Delete button to permanently remove them.
Configuring a Webhook
The image shown below describes the options for configuring a Webhook.
- Use the Name field to create a Webhook name that will uniquely identify the Webhook.
- Set up the Endpoint URI. This URI will be hit when the Event occurs.
- You may set the Webhook as Enabled - true or false. This allows you to temporarily suspend a Webhook without completely removing (deleting) it from the system.
- You may set the option to Post multiple events in JSON array if you want to have multiple events posted to your service in an array. If you select this option your service must be able to handle both multiple and single events.
- You can add up to three request headers and the value of those headers. This allows you to post headers in a secure way to services such as Azure Event Hubs, Azure Functions, Google Functions and Amazon Lambda.
Note
The request header keys can be up to 64 characters and the values can be up to 256 characters for each header.
- Set up the Filters to only process the Events you need. You can filter by Event Name, Event Source, and PlayerID.
Note
You can have several Filters per Group, but each Filter setting must be matched for the event to fall into the Filter Group.
- You may define several Filter Groups to include different filters. Events must fall into at least one group to be passed to the Webhook.