Skip to main content

Player Verify Webhook

Aghanim utilizes a player verification webhook to inform your game about player logins, requiring confirmation from your webhook server to permit or deny access to the game hub. This document details the operation of these webhooks.

The webhook verifies a player's registration in your game and may be invoked multiple times during the player interactions with the game hub.

Verify player flow imageVerify player flow image

Requirements

To use player verification webhooks from Aghanim, you should have the webhook server configured as follows:

Configuration

Below are function templates designed for an endpoint that processes player verification events generated by Aghanim:

Once your function is ready:

  1. Make your endpoint available.
  2. Register your endpoint within Aghanim account → Game → Webhooks → New Webhook by choosing the player verification event type.

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

The Event Data schema

KeyTypeDescription
player_idstringThe unique Player ID chosen for player authentication.

Response schema

Upon a successful player verification, your server is expected to return a status code in the 2xx range and the following JSON payload containing player data:

KeyTypeDescriptionRequired?
player_idstringUnique Player ID chosen for player authentication.Yes
namestringPlayer's nickname.Yes
attributesAttributesBasic player attributes expected by Aghanim.Yes
avatar_urlstringPlayer's avatar URL.No
emailstringPlayer's email address.No
bannedbooleanIndicates whether the player is banned in the game.No
segmentsstring[]Segments to which the player belongs.No
countrystringTwo-letter country code according to ISO 3166‑1.No
custom_attributesCustomAttributesCustom player attributes.No
balancesBalance[]Player's virtual currency balances.No

The Balance object

The balance object contains the following fields:

KeyTypeDescriptionRequired?
skustringItem SKU matching on both the game and Aghanim sides linked to the virtual currency.Yes
quantitynumberPlayer's balance in the currency.Yes

The Attribute object

The attribute object contains the following fields:

KeyTypeDescriptionRequired?
levelnumberPlayer's level in the game.Yes
platformstringThe platform on which the player is using the game hub. Possible values: ios, android.No
marketplacestringMarketplace from which the player originates. Possible values: app_store, google_play, other.No
soft_currency_amountnumberPlayer's soft currency balance.No
hard_currency_amountnumberPlayer's hard currency balance.No

The Custom Attributes object

The custom_attributes object contains key-value pairs, for example:

{
"is_premium": true,
"age": 25,
"favorite_color": "blue",
"install_date": "2024-01-01"
}

These attributes can be used later in LiveOps or Segmentation for constructing logic conditions to target specific player segments.

warning

Important: custom attributes must be declared in Game → Player attributes.

Successful response example:

{
"player_id": "2D2R-OP3C",
"name": "Beebee-Ate",
"avatar_url": "https://static-platform.aghanim.com/images/bb8.jpg",
"attributes": {"level": 2},
"country": "US"
}

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