Daily Reward Webhook
The daily_reward.get webhook resolves which items a player receives from a daily reward program. When a program is configured to be webhook-driven, Aghanim calls your server to ask which items to grant per day (and for the extra reward), and builds the player-facing reward based on your response in real time.
This webhook is triggered in the following cases:
- A player opens the daily reward widget in the Game Hub.
- A player claims a daily reward.
If your server does not respond, responds with a non-2xx status, times out, or returns a body that cannot be parsed, Aghanim silently falls back to the items configured statically for the program. This keeps daily rewards working even when your backend is temporarily unavailable.
Requirements
To use the daily_reward.get webhook from Aghanim, configure your webhook server as follows:
- HTTPS endpoint, accepting POST webhook requests.
- Listen for events generated and signed by Aghanim.
- Respond with
2xxstatus codes and a JSON body describing the reward items. - Respond quickly — slow responses degrade the hub experience and trigger the static fallback.
Configuration
- Develop a function for the
daily_reward.getwebhook processing. - Make your endpoint available.
- Register your endpoint within your Aghanim account → Game → Webhooks → Add webhook by choosing the
daily_reward.getevent type. - In the daily reward program settings, select the webhook so the program resolves its items through it.
- Place the daily reward widget on your Game Hub page so players can open it and trigger the webhook.
Alternatively, you can register your endpoint within Aghanim using the Create Webhook API method.
Trigger values
| Value | Description |
|---|---|
hub.interact | When the player opens the daily reward widget in the game hub. |
hub.daily_reward_claim | When the player claims a daily reward — to resolve the items to grant. |
test | When using the "Send test event" in the Dashboard. |
See the full events and triggers matrix for how daily_reward.get relates to other event types.
Request schema
Below is an example of an daily_reward.get webhook request:
- HTTP
- cURL
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": "daily_reward.get",
"event_data": {
"player_id": "2D2R-OP3C",
"id": "dlrwd_eAeXgQGcaie",
"key": "season-1",
"is_anonymous": false
},
"event_time": 1725548450,
"event_id": "whevt_eCacGbJVbvToOgzjXUgOCitkQE",
"idempotency_key": null,
"request_id": "d1593e9c-c291-4004-8846-6679c2e5810b",
"sandbox": false,
"trigger": "hub.interact",
"transaction_id": "whtx_eCacGbJVbvT",
"context": null,
"game_id": "gm_exTAyxPsVwh"
}
curl "https://your-webhook-endpoint.com/your/webhook/uri" \
-X POST \
-H "Content-Type: application/json" \
-H "User-Agent: Aghanim/0.1.0" \
-H "X-Aghanim-Signature: 2e45ed4dede5e09506717490655d2f78e96d4261040ef48cc623a780bda38812" \
-H "X-Aghanim-Signature-Timestamp: 1725548450" \
-d '{
"event_type": "daily_reward.get",
"event_data": {
"player_id": "2D2R-OP3C",
"id": "dlrwd_eAeXgQGcaie",
"key": "season-1",
"is_anonymous": false
},
"event_time": 1725548450,
"event_id": "whevt_eCacGbJVbvToOgzjXUgOCitkQE",
"idempotency_key": null,
"request_id": "d1593e9c-c291-4004-8846-6679c2e5810b",
"sandbox": false,
"trigger": "hub.interact",
"transaction_id": "whtx_eCacGbJVbvT",
"context": null,
"game_id": "gm_exTAyxPsVwh"
}'
The Event schema
| Key | Type | Description |
|---|---|---|
event_id | string | Unique Event ID generated by Aghanim. |
game_id | string | Your game ID in the Aghanim system. |
event_type | string | The type of the event, daily_reward.get in this case. |
event_time | number | Event date in Unix epoch time. |
event_data | EventData | Contains the event-specific data, with possible keys for inherited objects. |
idempotency_key | string|null | Ensures webhook actions are executed only once, even if retried. Can be null depending on event type. |
request_id | string|null | If the event was triggered by an API request, the request ID is included. |
sandbox | boolean | Indicates whether the event was sent from the sandbox game environment. |
trigger | string|null | The trigger that caused the event to be sent. |
transaction_id | string | The transaction ID generated by Aghanim. This ID may be the same for multiple events emitted within the same transaction. |
context | EventContext|null | Contextual information about the event. |
The EventContext schema
| Key | Type | Description |
|---|---|---|
order | OrderContext|null | Order information associated with the event if applicable. |
player | PlayerContext|null | (Optional) Player information. To add this, enable "Add player context" in the webhook settings. |
The EventData schema
| Key | Type | Description |
|---|---|---|
player_id | string | The unique Player ID chosen for player authentication. |
id | string | Unique daily reward program ID generated by Aghanim. |
key | string|null | Game-defined key of the daily reward program. |
is_anonymous | boolean | Indicates whether the current user is unauthenticated (anonymous). |
Response schema
Return 200 OK with the following JSON payload. Both keys are optional — return only the days and extra reward you want to override; anything omitted falls back to the program's static configuration.
| Key | Type | Description | Required? |
|---|---|---|---|
days | DailyRewardDay[] | Items granted per reward day. | No |
extra_reward_items | DailyRewardItem[] | Items granted for the extra reward. | No |
The DailyRewardDay schema
| Key | Type | Description | Required? |
|---|---|---|---|
day_number | number | Reward day the items belong to (≥ 1). | Yes |
items | DailyRewardItem[] | Items granted for the day (1–10 items). | Yes |
The DailyRewardItem schema
| Key | Type | Description | Required? |
|---|---|---|---|
sku | string | SKU of the item granted for the reward. Must match a SKU in your catalog. | Yes |
quantity | number|null | Item quantity. Falls back to the item's default when omitted. | No |
SKUs that do not match an item in the game's Aghanim catalog are silently ignored.
Example response
{
"days": [
{
"day_number": 1,
"items": [
{ "sku": "sword-001", "quantity": 1 },
{ "sku": "coins-pack", "quantity": 500 }
]
},
{
"day_number": 2,
"items": [
{ "sku": "shield-001" }
]
}
],
"extra_reward_items": [
{ "sku": "gem-pack", "quantity": 10 }
]
}
Need help? Contact our integration team at [email protected]
Need help?
Contact our integration team at [email protected]