Skip to main content

In-Game Popup Webhook

Through Aghanim's LiveOps Builder, developers can trigger in-game popups in response to player actions or interactions within the Aghanim-generated game hub. Once the conditions outlined in a campaign are met, Aghanim dispatches a webhook to your game containing the popup content specified in the campaign.

Upon receiving this webhook, your game is expected to display the in-game popup to players. The design and development of the frontend part of the popup should align with your game's visual and interaction guidelines.

Requirements

To use the in-game popup webhook from Aghanim, you should have the webhook server configured as follows:

  • HTTPS endpoint, accepting POST webhook requests.
  • Listen for events, generated and signed by Aghanim.
  • Trigger the display of in-game popups using the received content, adhering to the game's design standards.
  • Respond with 2xx status codes upon successful receipt and processing of the webhook, and 4xx or 5xx for denial or errors.

Configuration

  1. Develop a function for the ingame.popup webhook processing.
  2. Make your endpoint available.
  3. Register your endpoint within Aghanim account → GameWebhooksNew Webhook by choosing the in-game popup event type.
  4. Configure a liveops campaign that will trigger an in-game popup webhook.

Guide on configuring a campaign for an in-game popup

Alternatively, you can register your endpoint within Aghanim using the Create Webhook API method.

Request schema

Below is an example of an ingame.popup webhook request:

POST /your/webhook/uri HTTP/1.1
Content-Type: application/json
Host: your-webhook-endpoint.com
User-Agent: Aghanim/0.1.0
X-Aghanim-Signature: 2e45ed4dede5e09506717490655d2f78e96d4261040ef48cc623a780bda38812
X-Aghanim-Signature-Timestamp: 1725548450

{
"event_type": "ingame.popup",
"event_data": {
"player_id": "2D2R-OP3C",
"title": "Hello!",
"body": "How are you today? Claim your reward now!",
"icon": null,
"url": null
},
"event_time": 1725548450,
"event_id": "whevt_eCacGbJVbvToOgzjXUgOCitkQE",
"idempotency_key": null,
"request_id": "d1593e9c-c291-4004-8846-6679c2e5810b",
"sandbox": false,
"trigger": "liveops.execute_action",
"transaction_id": "whtx_eCacGbJVbvT",
"context": null,
"game_id": "gm_exTAyxPsVwh"
}

The Event schema

KeyTypeDescription
event_idstringUnique Event ID generated by Aghanim.
game_idstringYour game ID in the Aghanim system.
event_typestringThe type of the event, ingame.popup in this case.
event_timenumberEvent date in Unix epoch time.
event_dataEventDataContains the event-specific data, with possible keys for inherited objects.
idempotency_keystring|nullEnsures webhook actions are executed only once, even if retried. Can be null depending on event type.
request_idstring|nullIf the event was triggered by an API request, the request ID is included.
sandboxbooleanIndicates whether the event was sent from the sandbox game environment.
triggerstring|nullThe trigger that caused the event to be sent.
transaction_idstringThe transaction ID generated by Aghanim. This ID may be the same for multiple events emitted within the same transaction.
contextEventContext|nullContextual information about the event.

The EventContext schema

KeyTypeDescription
orderOrderContext|nullOrder information associated with the event if applicable.
playerPlayerContext|null(Optional) Player information. To add this, enable "Add player context" in the webhook settings.

The EventData schema

KeyTypeDescription
player_idstringThe unique Player ID chosen for player authentication to display the popup to.
titlestringThe popup title.
bodystringThe popup body.
iconstring|nullThe popup icon URL.
urlstring|nullURL to open in the browser when a player clicks on the popup.

Need help?
Contact our integration team at integration@aghanim.com