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
아래는 예시입니다 daily_reward.get 웹훅 요청:
- 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"
}'
이벤트 스키마
| Key | 유형 | 설명 |
|---|---|---|
event_id | string | Aghanim에 의해 생성된 고유 이벤트 ID. |
game_id | string | Aghanim 시스템에서의 귀하의 게임 ID. |
event_type | string | 이벤트의 유형, daily_reward.get 이럴 경우. |
event_time | number | 유닉스 에포크 시간으로 된 이벤트 날짜. |
event_data | EventData | 이벤트 특정 데이터가 포함되어 있으며, 상속된 객체에 대한 가능한 키가 포함됩니다. |
idempotency_key | string|null | 웹훅 작업이 재시도되어도 한 번만 실행되도록 보장합니다. 일 수 있습니다 null 이벤트 유형에 따라 달라집니다. |
request_id | string|null | 이벤트가 API 요청에 의해 트리거된 경우, 요청 ID가 포함됩니다. |
sandbox | boolean | 이 이벤트가 샌드박스 게임 환경에서 전송되었는지를 표시합니다. |
trigger | string|null | 이벤트가 전송된 원인이 된 트리거입니다. |
transaction_id | string | Aghanim이 생성한 거래 ID입니다. 이 ID는 동일한 거래 내에서 발생한 여러 이벤트에서 동일할 수 있습니다. |
context | EventContext|null | 이벤트에 대한 컨텍스트 정보. |
EventContext 스키마
| Key | 유형 | 설명 |
|---|---|---|
order | OrderContext|null | 해당되는 경우 이벤트와 관련된 주문 정보입니다. |
player | PlayerContext|null | 플레이어 정보를 추가하려면 웹훅 설정에서 "플레이어 컨텍스트 추가"를 활성화하세요. |
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]
도움이 필요하세요?
통합팀에 문의하십시오 [email protected]