@smartico/public-api 0.0.336 → 0.0.339

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/{PointsHistory/PointsHistoryLog.d.ts → ActivityLog/ActivityLogEntry.d.ts} +1 -1
  2. package/dist/{PointsHistory/GetPointsHistoryRequest.d.ts → ActivityLog/GetActivityLogRequest.d.ts} +1 -1
  3. package/dist/ActivityLog/GetActivityLogResponse.d.ts +7 -0
  4. package/dist/ActivityLog/index.d.ts +5 -0
  5. package/dist/Analytics/AnalyticStoreData.d.ts +1 -1
  6. package/dist/CustomSections/AchCustomSection.d.ts +1 -1
  7. package/dist/CustomSections/UICustomSection.d.ts +1 -0
  8. package/dist/SmarticoAPI.d.ts +4 -4
  9. package/dist/Store/StoreItemPublicMeta.d.ts +3 -0
  10. package/dist/WSAPI/WSAPI.d.ts +9 -9
  11. package/dist/WSAPI/WSAPITypes.d.ts +12 -4
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js +27 -22
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.modern.mjs +25 -20
  16. package/dist/index.modern.mjs.map +1 -1
  17. package/docs/enums/AchCustomSectionType.md +2 -2
  18. package/docs/interfaces/AchCategory.md +19 -0
  19. package/docs/interfaces/AchCategoryPublicMeta.md +19 -0
  20. package/docs/interfaces/AchCustomSectionType.md +21 -0
  21. package/docs/interfaces/AchievementPublicMeta.md +155 -0
  22. package/docs/interfaces/Bonus.md +107 -0
  23. package/docs/interfaces/GetTournamentInfoResponse.md +37 -0
  24. package/docs/interfaces/InboxMessage.md +51 -0
  25. package/docs/interfaces/InboxMessageBody.md +64 -0
  26. package/docs/interfaces/Level.md +67 -0
  27. package/docs/interfaces/LevelPublicMeta.md +51 -0
  28. package/docs/interfaces/SAWPrizesHistory.md +18 -0
  29. package/docs/interfaces/StoreCategory.md +19 -0
  30. package/docs/interfaces/StoreCategoryPublicMeta.md +19 -0
  31. package/docs/interfaces/StoreItem.md +59 -0
  32. package/docs/interfaces/TStoreItem.md +25 -1
  33. package/docs/interfaces/TUICustomSection.md +8 -0
  34. package/docs/interfaces/Tournament.md +187 -0
  35. package/docs/interfaces/TournamentPlayer.md +75 -0
  36. package/docs/interfaces/TournamentPrize.md +75 -0
  37. package/docs/interfaces/UICustomSection.md +123 -0
  38. package/docs/interfaces/UserAchievement.md +275 -0
  39. package/docs/interfaces/UserAchievementTask.md +67 -0
  40. package/docs/native/ADDING_METHODS.md +38 -0
  41. package/docs/native/PROTOCOL.md +2264 -0
  42. package/package.json +1 -1
  43. package/src/{PointsHistory/PointsHistoryLog.ts → ActivityLog/ActivityLogEntry.ts} +2 -1
  44. package/src/{PointsHistory/GetPointsHistoryRequest.ts → ActivityLog/GetActivityLogRequest.ts} +2 -1
  45. package/src/{PointsHistory/GetPointsHistoryResponse.ts → ActivityLog/GetActivityLogResponse.ts} +9 -8
  46. package/src/{PointsHistory → ActivityLog}/PointChangeSourceType.ts +1 -0
  47. package/src/{PointsHistory → ActivityLog}/UserBalanceType.ts +1 -0
  48. package/src/ActivityLog/index.ts +7 -0
  49. package/src/Analytics/AnalyticStoreData.ts +1 -1
  50. package/src/CustomSections/AchCustomSection.ts +1 -1
  51. package/src/CustomSections/UICustomSection.ts +7 -0
  52. package/src/SmarticoAPI.ts +10 -10
  53. package/src/Store/StoreItem.ts +3 -0
  54. package/src/Store/StoreItemPublicMeta.ts +3 -0
  55. package/src/WSAPI/WSAPI.ts +16 -16
  56. package/src/WSAPI/WSAPITypes.ts +13 -4
  57. package/src/index.ts +1 -1
  58. package/dist/PointsHistory/GetPointsHistoryResponse.d.ts +0 -7
  59. package/dist/PointsHistory/index.d.ts +0 -5
  60. package/src/PointsHistory/index.ts +0 -6
  61. /package/dist/{PointsHistory → ActivityLog}/PointChangeSourceType.d.ts +0 -0
  62. /package/dist/{PointsHistory → ActivityLog}/UserBalanceType.d.ts +0 -0
@@ -0,0 +1,2264 @@
1
+ # Smartico Native Protocol
2
+
3
+ Protocol documentation for native clients.
4
+
5
+ This document describes the low-level protocol for communicating with Smartico backend via WebSocket. Each method has a request ClassId and response ClassId that should be used to identify the message type.
6
+
7
+ ---
8
+
9
+ ## Table of Contents
10
+
11
+ ### Server Initiated Messages
12
+ - [Overview](#server-initiated-messages)
13
+ - [CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT](#client_public_properties_changed_event)
14
+ - [CLIENT_ENGAGEMENT_EVENT_NEW](#client_engagement_event_new)
15
+ - [RELOAD_ACHIEVEMENTS_EVENT](#reload_achievements_event)
16
+ - [SAW_SPINS_COUNT_PUSH](#saw_spins_count_push)
17
+ - [SAW_SHOW_SPIN_PUSH](#saw_show_spin_push)
18
+ - [JP_WIN_PUSH](#jp_win_push)
19
+
20
+ ### API Methods
21
+
22
+ #### User
23
+ - [getUserGamificationInfo](#getusergamificationinfo)
24
+ - [checkSegmentMatch](#checksegmentmatch)
25
+ - [checkSegmentListMatch](#checksegmentlistmatch)
26
+
27
+ #### Levels
28
+ - [getLevels](#getlevels)
29
+
30
+ #### Missions
31
+ - [getMissions](#getmissions)
32
+ - [requestMissionOptIn](#requestmissionoptin)
33
+ - [requestMissionClaimReward](#requestmissionclaimreward)
34
+ - [getAchCategories](#getachcategories)
35
+
36
+ #### Custom Sections
37
+ - [getCustomSections](#getcustomsections)
38
+
39
+ #### Bonuses
40
+ - [getBonuses](#getbonuses)
41
+ - [claimBonus](#claimbonus)
42
+
43
+ #### Store
44
+ - [getStoreItems](#getstoreitems)
45
+ - [buyStoreItem](#buystoreitem)
46
+ - [getStoreCategories](#getstorecategories)
47
+ - [getStorePurchasedItems](#getstorepurchaseditems)
48
+
49
+ #### Mini-Games
50
+ - [getMiniGames](#getminigames)
51
+ - [playMiniGame](#playminigame)
52
+ - [playMiniGameBatch](#playminigamebatch)
53
+ - [miniGameWinAcknowledge](#minigamewinacknowledge)
54
+ - [getMiniGamesHistory](#getminigameshistory)
55
+
56
+ #### Tournaments
57
+ - [getTournamentsList](#gettournamentslist)
58
+ - [getTournamentInstanceInfo](#gettournamentinstanceinfo)
59
+ - [registerInTournament](#registerintournament)
60
+
61
+ #### Leaderboard
62
+ - [getLeaderBoard](#getleaderboard)
63
+
64
+ #### Inbox
65
+ - [getInboxMessages](#getinboxmessages)
66
+ - [getInboxUnreadCount](#getinboxunreadcount)
67
+ - [getInboxMessageBody](#getinboxmessagebody)
68
+ - [markInboxMessageAsRead](#markinboxmessageasread)
69
+ - [markAllInboxMessagesAsRead](#markallinboxmessagesasread)
70
+ - [markInboxMessageAsFavorite](#markinboxmessageasfavorite)
71
+ - [deleteInboxMessage](#deleteinboxmessage)
72
+ - [deleteAllInboxMessages](#deleteallinboxmessages)
73
+
74
+ #### Jackpots
75
+ - [getJackpots](#getjackpots)
76
+ - [jackpotOptIn](#jackpotoptin)
77
+ - [jackpotOptOut](#jackpotoptout)
78
+ - [getJackpotWinners](#getjackpotwinners)
79
+ - [getJackpotEligibleGames](#getjackpoteligiblegames)
80
+
81
+ #### Other
82
+ - [getTranslations](#gettranslations)
83
+ - [getPointsHistory](#getpointshistory)
84
+ - [getRelatedItemsForGame](#getrelateditemsforgame)
85
+
86
+ #### Raffles
87
+ - [getRaffles](#getraffles)
88
+ - [getRaffleDrawRun](#getraffledrawrun)
89
+ - [getRaffleDrawRunsHistory](#getraffledrawrunshistory)
90
+ - [claimRafflePrize](#claimraffleprize)
91
+ - [requestRaffleOptin](#requestraffleoptin)
92
+
93
+ ---
94
+
95
+ # Server Initiated Messages
96
+
97
+ Server initiated messages are sent by the server to the client without a prior request. The client should listen for these ClassIds and react accordingly (update UI, show notification, re-fetch data).
98
+
99
+ Unlike request/response methods, server initiated messages can arrive at any time during an active WebSocket connection.
100
+
101
+ ## Summary
102
+
103
+ | ClassId | Name | Description |
104
+ |---------|------|-------------|
105
+ | `108` | CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT | User properties changed (balance, points) |
106
+ | `110` | CLIENT_ENGAGEMENT_EVENT_NEW | New inbox message received |
107
+ | `504` | RELOAD_ACHIEVEMENTS_EVENT | Achievements/missions data changed |
108
+ | `706` | SAW_SPINS_COUNT_PUSH | Spin count updated |
109
+ | `707` | SAW_SHOW_SPIN_PUSH | Trigger to show mini-game |
110
+ | `808` | JP_WIN_PUSH | Jackpot win notification |
111
+
112
+ ---
113
+
114
+ ## CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT
115
+
116
+ Sent when user's public properties change (points balance, gems, inbox count, etc.).
117
+
118
+ **ClassId:** `108`
119
+
120
+ **Example:**
121
+
122
+ ```json
123
+ {
124
+ "cid": 108,
125
+ "props": {
126
+ "core_inbox_unread_count": 3,
127
+ "ach_points_balance": 1500,
128
+ "ach_gems_balance": 25,
129
+ "ach_diamonds_balance": 10
130
+ }
131
+ }
132
+ ```
133
+
134
+ **Fields:**
135
+
136
+ | Field | Type | Description |
137
+ |-------|------|-------------|
138
+ | `cid` | `number` | Message type identifier |
139
+ | `props.core_inbox_unread_count` | `number` | Number of unread inbox messages |
140
+ | `props.ach_points_balance` | `number` | Current points balance |
141
+ | `props.ach_gems_balance` | `number` | Current gems balance |
142
+ | `props.ach_diamonds_balance` | `number` | Current diamonds balance |
143
+
144
+ **Recommended action:** Update UI elements showing user balance or inbox badge.
145
+
146
+ ---
147
+
148
+ ## CLIENT_ENGAGEMENT_EVENT_NEW
149
+
150
+ Sent when a new engagement event (inbox message) is received.
151
+
152
+ **ClassId:** `110`
153
+
154
+ **Example:**
155
+
156
+ ```json
157
+ {
158
+ "cid": 110
159
+ }
160
+ ```
161
+
162
+ **Fields:**
163
+
164
+ | Field | Type | Description |
165
+ |-------|------|-------------|
166
+ | `cid` | `number` | Message type identifier |
167
+
168
+ **Recommended action:** Re-fetch inbox messages using the appropriate API method.
169
+
170
+ ---
171
+
172
+ ## RELOAD_ACHIEVEMENTS_EVENT
173
+
174
+ Sent when achievements or missions data has changed and needs to be refreshed.
175
+
176
+ **ClassId:** `504`
177
+
178
+ **Example:**
179
+
180
+ ```json
181
+ {
182
+ "cid": 504
183
+ }
184
+ ```
185
+
186
+ **Fields:**
187
+
188
+ | Field | Type | Description |
189
+ |-------|------|-------------|
190
+ | `cid` | `number` | Message type identifier |
191
+
192
+ **Recommended action:** Re-fetch missions/achievements data using the appropriate API method.
193
+
194
+ ---
195
+
196
+ ## SAW_SPINS_COUNT_PUSH
197
+
198
+ Sent when the user's available spin count changes.
199
+
200
+ **ClassId:** `706`
201
+
202
+ **Example:**
203
+
204
+ ```json
205
+ {
206
+ "cid": 706,
207
+ "saw_template_id": 123,
208
+ "spin_count": 5
209
+ }
210
+ ```
211
+
212
+ **Fields:**
213
+
214
+ | Field | Type | Description |
215
+ |-------|------|-------------|
216
+ | `cid` | `number` | Message type identifier |
217
+ | `saw_template_id` | `number` | ID of the mini-game template |
218
+ | `spin_count` | `number` | Current number of available spins |
219
+
220
+ **Recommended action:** Update the spin count badge/counter in UI.
221
+
222
+ ---
223
+
224
+ ## SAW_SHOW_SPIN_PUSH
225
+
226
+ Sent as a trigger to display a mini-game to the user (Spin-A-Wheel, Scratch Card, Slot, etc.).
227
+
228
+ **ClassId:** `707`
229
+
230
+ **Example:**
231
+
232
+ ```json
233
+ {
234
+ "cid": 707
235
+ }
236
+ ```
237
+
238
+ **Fields:**
239
+
240
+ | Field | Type | Description |
241
+ |-------|------|-------------|
242
+ | `cid` | `number` | Message type identifier |
243
+
244
+ **Recommended action:** Fetch mini-game templates and display the appropriate game modal/screen.
245
+
246
+ ---
247
+
248
+ ## JP_WIN_PUSH
249
+
250
+ Sent when a jackpot is won (can be the current user or another player).
251
+
252
+ **ClassId:** `808`
253
+
254
+ **Example:**
255
+
256
+ ```json
257
+ {
258
+ "cid": 808,
259
+ "jackpot": {
260
+ "jp_id": 456,
261
+ "name": "Mega Jackpot",
262
+ "current_value": 10000
263
+ },
264
+ "winners": [
265
+ {
266
+ "user_id": "user123",
267
+ "amount": 10000,
268
+ "won_at": 1704067200000
269
+ }
270
+ ]
271
+ }
272
+ ```
273
+
274
+ **Fields:**
275
+
276
+ | Field | Type | Description |
277
+ |-------|------|-------------|
278
+ | `cid` | `number` | Message type identifier |
279
+ | `jackpot` | [`JackpotDetails`](../interfaces/JackpotDetails.md) | Jackpot information |
280
+ | `winners` | [`JackPotWinner[]`](../interfaces/JackPotWinner.md) | Array of winners |
281
+
282
+ **Recommended action:** Show jackpot win notification/celebration. Re-fetch jackpot data to update UI.
283
+
284
+ ---
285
+
286
+ # API Methods
287
+
288
+ ## User
289
+
290
+ ### getUserGamificationInfo
291
+
292
+ Get user's gamification data including points, level, balances and counters.
293
+
294
+ #### Request
295
+
296
+ **ClassId:** `527` (GET_ACHIEVEMENT_USER_REQUEST)
297
+
298
+ | Field | Type | Description |
299
+ |-------|------|-------------|
300
+ | `cid` | `number` | `527` |
301
+ | `uuid` | `string` | Unique request identifier |
302
+ | `ts` | `number` | Timestamp (ms) |
303
+
304
+ **Example:**
305
+
306
+ ```json
307
+ {
308
+ "cid": 527,
309
+ "uuid": "abc-123",
310
+ "ts": 1699999999999
311
+ }
312
+ ```
313
+
314
+ #### Response
315
+
316
+ **ClassId:** `528` (GET_ACHIEVEMENT_USER_RESPONSE)
317
+
318
+ | Field | Type | Description |
319
+ |-------|------|-------------|
320
+ | `cid` | `number` | `528` |
321
+ | `uuid` | `string` | Request identifier (matches request) |
322
+ | `errCode` | `number` | Error code (`0` = success) |
323
+ | `errMsg` | `string` | Error message (if any) |
324
+ | `points_balance` | `number` | Current points balance |
325
+ | `gems_balance` | `number` | Current gems balance |
326
+ | `diamonds_balance` | `number` | Current diamonds balance |
327
+ | `points_ever` | `number` | Total points ever earned |
328
+ | `current_level` | `number` | Current user level ID |
329
+ | `level_counter_1` | `number` | Level counter 1 (for advanced leveling) |
330
+ | `level_counter_2` | `number` | Level counter 2 (for advanced leveling) |
331
+ | `points_board_period_type_1` | `number` | Points for leaderboard period type 1 |
332
+ | `points_board_period_type_2` | `number` | Points for leaderboard period type 2 |
333
+ | `points_board_period_type_3` | `number` | Points for leaderboard period type 3 |
334
+
335
+ **Example:**
336
+
337
+ ```json
338
+ {
339
+ "cid": 528,
340
+ "uuid": "abc-123",
341
+ "errCode": 0,
342
+ "points_balance": 1500,
343
+ "gems_balance": 50,
344
+ "diamonds_balance": 10,
345
+ "points_ever": 25000,
346
+ "current_level": 5,
347
+ "level_counter_1": 100,
348
+ "level_counter_2": 0,
349
+ "points_board_period_type_1": 500,
350
+ "points_board_period_type_2": 1200,
351
+ "points_board_period_type_3": 3000
352
+ }
353
+ ```
354
+
355
+ ---
356
+
357
+ ### checkSegmentMatch
358
+
359
+ Check if the current user belongs to a specific segment.
360
+
361
+ #### Request
362
+
363
+ **ClassId:** `161`
364
+
365
+ **Example:**
366
+
367
+ ```json
368
+ {
369
+ "cid": 161,
370
+ "uuid": "550e8400-e29b-41d4-a716-446655440000",
371
+ "ts": 1704067200000,
372
+ "segment_id": [42]
373
+ }
374
+ ```
375
+
376
+ **Fields:**
377
+
378
+ | Field | Type | Required | Description |
379
+ |-------|------|----------|-------------|
380
+ | `cid` | `number` | ✓ | Message type identifier |
381
+ | `uuid` | `string` | ✓ | Unique request identifier |
382
+ | `ts` | `number` | ✓ | Timestamp in milliseconds |
383
+ | `segment_id` | `number[]` | ✓ | Array with single segment ID |
384
+
385
+ ---
386
+
387
+ #### Response
388
+
389
+ **ClassId:** `162`
390
+
391
+ **Example:**
392
+
393
+ ```json
394
+ {
395
+ "cid": 162,
396
+ "errCode": 0,
397
+ "errMsg": null,
398
+ "segments": [
399
+ { "segment_id": 42, "is_matching": true }
400
+ ]
401
+ }
402
+ ```
403
+
404
+ **Fields:**
405
+
406
+ | Field | Type | Description |
407
+ |-------|------|-------------|
408
+ | `cid` | `number` | Message type identifier |
409
+ | `errCode` | `number` | Error code. `0` = success |
410
+ | `errMsg` | `string` | Error message (if any) |
411
+ | `segments` | [`TSegmentCheckResult[]`](../interfaces/TSegmentCheckResult.md) | Array of segment check results |
412
+
413
+ ---
414
+
415
+ ### checkSegmentListMatch
416
+
417
+ Check if the current user belongs to multiple segments.
418
+
419
+ #### Request
420
+
421
+ **ClassId:** `161`
422
+
423
+ **Example:**
424
+
425
+ ```json
426
+ {
427
+ "cid": 161,
428
+ "uuid": "550e8400-e29b-41d4-a716-446655440000",
429
+ "ts": 1704067200000,
430
+ "segment_id": [1, 2, 3]
431
+ }
432
+ ```
433
+
434
+ **Fields:**
435
+
436
+ | Field | Type | Required | Description |
437
+ |-------|------|----------|-------------|
438
+ | `cid` | `number` | ✓ | Message type identifier |
439
+ | `uuid` | `string` | ✓ | Unique request identifier |
440
+ | `ts` | `number` | ✓ | Timestamp in milliseconds |
441
+ | `segment_id` | `number[]` | ✓ | Array of segment IDs to check |
442
+
443
+ ---
444
+
445
+ #### Response
446
+
447
+ **ClassId:** `162`
448
+
449
+ **Example:**
450
+
451
+ ```json
452
+ {
453
+ "cid": 162,
454
+ "errCode": 0,
455
+ "errMsg": null,
456
+ "segments": [
457
+ { "segment_id": 1, "is_matching": true },
458
+ { "segment_id": 2, "is_matching": false },
459
+ { "segment_id": 3, "is_matching": true }
460
+ ]
461
+ }
462
+ ```
463
+
464
+ **Fields:**
465
+
466
+ | Field | Type | Description |
467
+ |-------|------|-------------|
468
+ | `cid` | `number` | Message type identifier |
469
+ | `errCode` | `number` | Error code. `0` = success |
470
+ | `errMsg` | `string` | Error message (if any) |
471
+ | `segments` | [`TSegmentCheckResult[]`](../interfaces/TSegmentCheckResult.md) | Array of segment check results |
472
+
473
+ ---
474
+
475
+ ## Levels
476
+
477
+ ### getLevels
478
+
479
+ Get list of all levels defined in the system.
480
+
481
+ #### Request
482
+
483
+ **ClassId:** `500`
484
+
485
+ **Example:**
486
+
487
+ ```json
488
+ {
489
+ "cid": 500,
490
+ "uuid": "550e8400-e29b-41d4-a716-446655440000",
491
+ "ts": 1704067200000
492
+ }
493
+ ```
494
+
495
+ **Fields:**
496
+
497
+ | Field | Type | Required | Description |
498
+ |-------|------|----------|-------------|
499
+ | `cid` | `number` | ✓ | Message type identifier |
500
+ | `uuid` | `string` | ✓ | Unique request identifier |
501
+ | `ts` | `number` | ✓ | Timestamp in milliseconds |
502
+
503
+ ---
504
+
505
+ #### Response
506
+
507
+ **ClassId:** `501`
508
+
509
+ **Example:**
510
+
511
+ ```json
512
+ {
513
+ "cid": 501,
514
+ "errCode": 0,
515
+ "errMsg": null,
516
+ "levels": [
517
+ {
518
+ "level_id": 1,
519
+ "level_public_meta": {
520
+ "name": "Bronze",
521
+ "description": "Starting level",
522
+ "image_url": "https://cdn.example.com/bronze.png"
523
+ },
524
+ "required_points": 0,
525
+ "is_first_level": true,
526
+ "required_level_counter_1": 0,
527
+ "required_level_counter_2": 0,
528
+ "general_level_progress": 0
529
+ },
530
+ {
531
+ "level_id": 2,
532
+ "level_public_meta": {
533
+ "name": "Silver",
534
+ "description": "Second level",
535
+ "image_url": "https://cdn.example.com/silver.png"
536
+ },
537
+ "required_points": 1000,
538
+ "is_first_level": false,
539
+ "required_level_counter_1": 0,
540
+ "required_level_counter_2": 0,
541
+ "general_level_progress": 0
542
+ }
543
+ ]
544
+ }
545
+ ```
546
+
547
+ **Fields:**
548
+
549
+ | Field | Type | Description |
550
+ |-------|------|-------------|
551
+ | `cid` | `number` | Message type identifier |
552
+ | `errCode` | `number` | Error code. `0` = success |
553
+ | `errMsg` | `string` | Error message (if any) |
554
+ | `levels` | [`Level[]`](../interfaces/Level.md) | Array of level objects |
555
+
556
+ ---
557
+
558
+ ## Missions
559
+
560
+ ### getMissions
561
+
562
+ Get all missions and badges for the current user.
563
+
564
+ > **Note:** This API returns both Missions and Badges. Filter achievements entity by `ach_type_id` to get only missions (`1`) or only badges (`2`).
565
+
566
+ #### Request
567
+
568
+ **ClassId:** `502` (GET_ACHIEVEMENT_MAP_REQUEST)
569
+
570
+ | Field | Type | Description |
571
+ |-------|------|-------------|
572
+ | `cid` | `number` | `502` |
573
+ | `uuid` | `string` | Unique request identifier |
574
+ | `ts` | `number` | Timestamp (ms) |
575
+
576
+ **Example:**
577
+
578
+ ```json
579
+ {
580
+ "cid": 502,
581
+ "uuid": "abc-123",
582
+ "ts": 1699999999999
583
+ }
584
+ ```
585
+
586
+ #### Response
587
+
588
+ **ClassId:** `503` (GET_ACHIEVEMENT_MAP_RESPONSE)
589
+
590
+ | Field | Type | Description |
591
+ |-------|------|-------------|
592
+ | `cid` | `number` | `503` |
593
+ | `uuid` | `string` | Request identifier (matches request) |
594
+ | `errCode` | `number` | Error code (`0` = success) |
595
+ | `errMsg` | `string` | Error message (if any) |
596
+ | `achievements` | [`UserAchievement[]`](../interfaces/UserAchievement.md) | Array of achievements (missions + badges) |
597
+
598
+ **Example:**
599
+
600
+ ```json
601
+ {
602
+ "cid": 503,
603
+ "uuid": "abc-123",
604
+ "errCode": 0,
605
+ "achievements": [
606
+ {
607
+ "ach_id": 101,
608
+ "ach_type_id": 1,
609
+ "ach_public_meta": {
610
+ "name": "Daily Login",
611
+ "description": "Login every day for 7 days",
612
+ "image_url": "https://cdn.example.com/mission.png",
613
+ "reward": "100 Points"
614
+ },
615
+ "isCompleted": false,
616
+ "isLocked": false,
617
+ "requiresOptin": false,
618
+ "isOptedIn": true,
619
+ "progress": 42,
620
+ "achievementTasks": [
621
+ {
622
+ "task_id": 201,
623
+ "task_public_meta": {
624
+ "name": "Login Day 1"
625
+ },
626
+ "isCompleted": true,
627
+ "userProgress": 100,
628
+ "executionCount": 1,
629
+ "userExecutedCount": 1
630
+ }
631
+ ]
632
+ }
633
+ ]
634
+ }
635
+
636
+ ---
637
+
638
+ ### requestMissionOptIn
639
+
640
+ Opt-in to a mission that requires opt-in.
641
+
642
+ #### Request
643
+
644
+ **ClassId:** `525` (MISSION_OPTIN_REQUEST)
645
+
646
+ | Field | Type | Description |
647
+ |-------|------|-------------|
648
+ | `cid` | `number` | `525` |
649
+ | `uuid` | `string` | Unique request identifier |
650
+ | `ts` | `number` | Timestamp (ms) |
651
+ | `ach_id` | `number` | Mission ID |
652
+
653
+ #### Response
654
+
655
+ **ClassId:** `526` (MISSION_OPTIN_RESPONSE)
656
+
657
+ | Field | Type | Description |
658
+ |-------|------|-------------|
659
+ | `cid` | `number` | `526` |
660
+ | `uuid` | `string` | Request identifier |
661
+ | `errCode` | `number` | Error code (`0` = success) |
662
+ | `errMsg` | `string` | Error message (if any) |
663
+
664
+ ---
665
+
666
+ ### requestMissionClaimReward
667
+
668
+ Claim reward for a completed mission.
669
+
670
+ #### Request
671
+
672
+ **ClassId:** `539` (ACHIEVEMENT_CLAIM_PRIZE_REQUEST)
673
+
674
+ | Field | Type | Description |
675
+ |-------|------|-------------|
676
+ | `cid` | `number` | `539` |
677
+ | `uuid` | `string` | Unique request identifier |
678
+ | `ts` | `number` | Timestamp (ms) |
679
+ | `ach_id` | `number` | Mission ID |
680
+ | `ach_completed_id` | `number` | Completion record ID |
681
+
682
+ #### Response
683
+
684
+ **ClassId:** `540` (ACHIEVEMENT_CLAIM_PRIZE_RESPONSE)
685
+
686
+ | Field | Type | Description |
687
+ |-------|------|-------------|
688
+ | `cid` | `number` | `540` |
689
+ | `uuid` | `string` | Request identifier |
690
+ | `errCode` | `number` | Error code (`0` = success) |
691
+ | `errMsg` | `string` | Error message (if any) |
692
+
693
+ ---
694
+
695
+ ### getAchCategories
696
+
697
+ Get mission and badge categories.
698
+
699
+ #### Request
700
+
701
+ **ClassId:** `537` (GET_ACH_CATEGORIES_REQUEST)
702
+
703
+ | Field | Type | Description |
704
+ |-------|------|-------------|
705
+ | `cid` | `number` | `537` |
706
+ | `uuid` | `string` | Unique request identifier |
707
+ | `ts` | `number` | Timestamp (ms) |
708
+
709
+ #### Response
710
+
711
+ **ClassId:** `538` (GET_ACH_CATEGORIES_RESPONSE)
712
+
713
+ | Field | Type | Description |
714
+ |-------|------|-------------|
715
+ | `cid` | `number` | `538` |
716
+ | `uuid` | `string` | Request identifier |
717
+ | `errCode` | `number` | Error code (`0` = success) |
718
+ | `categories` | [`AchCategory[]`](../interfaces/AchCategory.md) | Array of categories |
719
+
720
+ ---
721
+
722
+ ## Custom Sections
723
+
724
+ ### getCustomSections
725
+
726
+ Get custom UI sections.
727
+
728
+ #### Request
729
+
730
+ **ClassId:** `523` (GET_CUSTOM_SECTIONS_REQUEST)
731
+
732
+ | Field | Type | Description |
733
+ |-------|------|-------------|
734
+ | `cid` | `number` | `523` |
735
+ | `uuid` | `string` | Unique request identifier |
736
+ | `ts` | `number` | Timestamp (ms) |
737
+
738
+ #### Response
739
+
740
+ **ClassId:** `524` (GET_CUSTOM_SECTIONS_RESPONSE)
741
+
742
+ | Field | Type | Description |
743
+ |-------|------|-------------|
744
+ | `cid` | `number` | `524` |
745
+ | `uuid` | `string` | Request identifier |
746
+ | `errCode` | `number` | Error code (`0` = success) |
747
+ | `customSections` | `object` | Map of section ID to [`UICustomSection`](../interfaces/UICustomSection.md) |
748
+
749
+ ---
750
+
751
+ ## Bonuses
752
+
753
+ ### getBonuses
754
+
755
+ Get all bonuses for the current user.
756
+
757
+ #### Request
758
+
759
+ **ClassId:** `600` (GET_BONUSES_REQUEST)
760
+
761
+ | Field | Type | Description |
762
+ |-------|------|-------------|
763
+ | `cid` | `number` | `600` |
764
+ | `uuid` | `string` | Unique request identifier |
765
+ | `ts` | `number` | Timestamp (ms) |
766
+
767
+ **Example:**
768
+
769
+ ```json
770
+ {
771
+ "cid": 600,
772
+ "uuid": "abc-123",
773
+ "ts": 1699999999999
774
+ }
775
+ ```
776
+
777
+ #### Response
778
+
779
+ **ClassId:** `601` (GET_BONUSES_RESPONSE)
780
+
781
+ | Field | Type | Description |
782
+ |-------|------|-------------|
783
+ | `cid` | `number` | `601` |
784
+ | `uuid` | `string` | Request identifier (matches request) |
785
+ | `errCode` | `number` | Error code (`0` = success) |
786
+ | `errMsg` | `string` | Error message (if any) |
787
+ | `bonuses` | [`Bonus[]`](../interfaces/Bonus.md) | Array of bonus objects |
788
+
789
+ **Example:**
790
+
791
+ ```json
792
+ {
793
+ "cid": 601,
794
+ "uuid": "abc-123",
795
+ "errCode": 0,
796
+ "bonuses": [
797
+ {
798
+ "id": 12345,
799
+ "redeemable": true,
800
+ "createDate": "2024-01-15T10:30:00Z",
801
+ "bonusStatusId": 1,
802
+ "labelBonusTemplateMetaMap": {
803
+ "description": "Welcome Bonus",
804
+ "acknowledge": "Claim your bonus!",
805
+ "image_url": "https://cdn.example.com/bonus.png"
806
+ },
807
+ "bonusMetaMap": {
808
+ "uiAmount": "$100"
809
+ }
810
+ }
811
+ ]
812
+ }
813
+ ```
814
+
815
+ ---
816
+
817
+ ### claimBonus
818
+
819
+ Claim a bonus by its ID.
820
+
821
+ #### Request
822
+
823
+ **ClassId:** `602` (CLAIM_BONUS_REQUEST)
824
+
825
+ | Field | Type | Description |
826
+ |-------|------|-------------|
827
+ | `cid` | `number` | `602` |
828
+ | `uuid` | `string` | Unique request identifier |
829
+ | `ts` | `number` | Timestamp (ms) |
830
+ | `bonusId` | `number` | ID of the bonus to claim |
831
+
832
+ **Example:**
833
+
834
+ ```json
835
+ {
836
+ "cid": 602,
837
+ "uuid": "abc-123",
838
+ "ts": 1699999999999,
839
+ "bonusId": 12345
840
+ }
841
+ ```
842
+
843
+ #### Response
844
+
845
+ **ClassId:** `603` (CLAIM_BONUS_RESPONSE)
846
+
847
+ | Field | Type | Description |
848
+ |-------|------|-------------|
849
+ | `cid` | `number` | `603` |
850
+ | `uuid` | `string` | Request identifier (matches request) |
851
+ | `errCode` | `number` | Error code (`0` = success) |
852
+ | `errMsg` | `string` | Error message (if any) |
853
+ | `success` | `boolean` | Whether the claim was successful |
854
+
855
+ **Example:**
856
+
857
+ ```json
858
+ {
859
+ "cid": 603,
860
+ "uuid": "abc-123",
861
+ "errCode": 0,
862
+ "success": true
863
+ }
864
+ ```
865
+
866
+ ---
867
+
868
+ ## Store
869
+
870
+ ### getStoreItems
871
+
872
+ Get all available store items.
873
+
874
+ #### Request
875
+
876
+ **ClassId:** `509` (GET_SHOP_ITEMS_REQUEST)
877
+
878
+ | Field | Type | Description |
879
+ |-------|------|-------------|
880
+ | `cid` | `number` | `509` |
881
+ | `uuid` | `string` | Unique request identifier |
882
+ | `ts` | `number` | Timestamp (ms) |
883
+
884
+ #### Response
885
+
886
+ **ClassId:** `510` (GET_SHOP_ITEMS_RESPONSE)
887
+
888
+ | Field | Type | Description |
889
+ |-------|------|-------------|
890
+ | `cid` | `number` | `510` |
891
+ | `uuid` | `string` | Request identifier |
892
+ | `errCode` | `number` | Error code (`0` = success) |
893
+ | `items` | [`StoreItem[]`](../interfaces/StoreItem.md) | Array of store items |
894
+
895
+ ---
896
+
897
+ ### buyStoreItem
898
+
899
+ Purchase a store item.
900
+
901
+ #### Request
902
+
903
+ **ClassId:** `511` (BUY_SHOP_ITEM_REQUEST)
904
+
905
+ | Field | Type | Description |
906
+ |-------|------|-------------|
907
+ | `cid` | `number` | `511` |
908
+ | `uuid` | `string` | Unique request identifier |
909
+ | `ts` | `number` | Timestamp (ms) |
910
+ | `itemId` | `number` | ID of the item to buy |
911
+
912
+ #### Response
913
+
914
+ **ClassId:** `512` (BUY_SHOP_ITEM_RESPONSE)
915
+
916
+ | Field | Type | Description |
917
+ |-------|------|-------------|
918
+ | `cid` | `number` | `512` |
919
+ | `uuid` | `string` | Request identifier |
920
+ | `errCode` | `number` | Error code (`0` = success) |
921
+ | `errMsg` | `string` | Error message (if any) |
922
+
923
+ ---
924
+
925
+ ### getStoreCategories
926
+
927
+ Get store categories.
928
+
929
+ #### Request
930
+
931
+ **ClassId:** `515` (GET_SHOP_CATEGORIES_REQUEST)
932
+
933
+ | Field | Type | Description |
934
+ |-------|------|-------------|
935
+ | `cid` | `number` | `515` |
936
+ | `uuid` | `string` | Unique request identifier |
937
+ | `ts` | `number` | Timestamp (ms) |
938
+
939
+ #### Response
940
+
941
+ **ClassId:** `516` (GET_SHOP_CATEGORIES_RESPONSE)
942
+
943
+ | Field | Type | Description |
944
+ |-------|------|-------------|
945
+ | `cid` | `number` | `516` |
946
+ | `uuid` | `string` | Request identifier |
947
+ | `errCode` | `number` | Error code (`0` = success) |
948
+ | `categories` | [`StoreCategory[]`](../interfaces/StoreCategory.md) | Array of categories |
949
+
950
+ ---
951
+
952
+ ### getStorePurchasedItems
953
+
954
+ Get user's purchase history.
955
+
956
+ #### Request
957
+
958
+ **ClassId:** `541` (ACH_SHOP_ITEM_HISTORY_REQUEST)
959
+
960
+ | Field | Type | Description |
961
+ |-------|------|-------------|
962
+ | `cid` | `number` | `541` |
963
+ | `uuid` | `string` | Unique request identifier |
964
+ | `ts` | `number` | Timestamp (ms) |
965
+ | `limit` | `number` | Max items to return (default 20) |
966
+ | `offset` | `number` | Offset for pagination |
967
+
968
+ #### Response
969
+
970
+ **ClassId:** `542` (ACH_SHOP_ITEM_HISTORY_RESPONSE)
971
+
972
+ | Field | Type | Description |
973
+ |-------|------|-------------|
974
+ | `cid` | `number` | `542` |
975
+ | `uuid` | `string` | Request identifier |
976
+ | `errCode` | `number` | Error code (`0` = success) |
977
+ | `items` | [`StoreItem[]`](../interfaces/StoreItem.md) | Array of purchased items |
978
+
979
+ ---
980
+
981
+ ## Mini-Games
982
+
983
+ ### getMiniGames
984
+
985
+ Get all available mini-games (spin wheels, scratch cards, etc.).
986
+
987
+ #### Request
988
+
989
+ **ClassId:** `700` (SAW_GET_SPINS_REQUEST)
990
+
991
+ | Field | Type | Description |
992
+ |-------|------|-------------|
993
+ | `cid` | `number` | `700` |
994
+ | `uuid` | `string` | Unique request identifier |
995
+ | `ts` | `number` | Timestamp (ms) |
996
+
997
+ #### Response
998
+
999
+ **ClassId:** `701` (SAW_GET_SPINS_RESPONSE)
1000
+
1001
+ | Field | Type | Description |
1002
+ |-------|------|-------------|
1003
+ | `cid` | `number` | `701` |
1004
+ | `uuid` | `string` | Request identifier |
1005
+ | `errCode` | `number` | Error code (`0` = success) |
1006
+ | `templates` | [`SAWTemplate[]`](../interfaces/SAWTemplate.md) | Array of mini-game templates |
1007
+
1008
+ ---
1009
+
1010
+ ### playMiniGame
1011
+
1012
+ Play a mini-game and get prize.
1013
+
1014
+ #### Request
1015
+
1016
+ **ClassId:** `702` (SAW_DO_SPIN_REQUEST)
1017
+
1018
+ | Field | Type | Description |
1019
+ |-------|------|-------------|
1020
+ | `cid` | `number` | `702` |
1021
+ | `uuid` | `string` | Unique request identifier |
1022
+ | `ts` | `number` | Timestamp (ms) |
1023
+ | `saw_template_id` | `number` | Mini-game template ID |
1024
+
1025
+ #### Response
1026
+
1027
+ **ClassId:** `703` (SAW_DO_SPIN_RESPONSE)
1028
+
1029
+ | Field | Type | Description |
1030
+ |-------|------|-------------|
1031
+ | `cid` | `number` | `703` |
1032
+ | `uuid` | `string` | Request identifier |
1033
+ | `errCode` | `number` | Error code (`0` = success) |
1034
+ | `saw_prize_id` | `number` | Won prize ID |
1035
+ | `request_id` | `string` | Request ID for acknowledgement |
1036
+
1037
+ ---
1038
+
1039
+ ### playMiniGameBatch
1040
+
1041
+ Play a mini-game multiple times in a single request.
1042
+
1043
+ #### Request
1044
+
1045
+ **ClassId:** `712` (SAW_DO_SPIN_BATCH_REQUEST)
1046
+
1047
+ | Field | Type | Description |
1048
+ |-------|------|-------------|
1049
+ | `cid` | `number` | `712` |
1050
+ | `uuid` | `string` | Unique request identifier |
1051
+ | `ts` | `number` | Timestamp (ms) |
1052
+ | `spins` | `array` | Array of spin objects with `request_id` (string) and `saw_template_id` (number) |
1053
+
1054
+ #### Response
1055
+
1056
+ **ClassId:** `713` (SAW_DO_SPIN_BATCH_RESPONSE)
1057
+
1058
+ | Field | Type | Description |
1059
+ |-------|------|-------------|
1060
+ | `cid` | `number` | `713` |
1061
+ | `uuid` | `string` | Request identifier |
1062
+ | `errCode` | `number` | Error code (`0` = success) |
1063
+ | `spins` | `array` | Array of spin results, each containing prize information |
1064
+
1065
+ #### Example
1066
+
1067
+ **Request:**
1068
+ ```json
1069
+ {
1070
+ "cid": 712,
1071
+ "uuid": "batch-123",
1072
+ "ts": 1699999999999,
1073
+ "spins": [
1074
+ { "request_id": "spin-1", "saw_template_id": 101 },
1075
+ { "request_id": "spin-2", "saw_template_id": 101 },
1076
+ { "request_id": "spin-3", "saw_template_id": 101 }
1077
+ ]
1078
+ }
1079
+ ```
1080
+
1081
+ **Response:**
1082
+ ```json
1083
+ {
1084
+ "cid": 713,
1085
+ "uuid": "batch-123",
1086
+ "errCode": 0,
1087
+ "spins": [
1088
+ { "request_id": "spin-1", "prize_type": 1, "prize_value": 100 },
1089
+ { "request_id": "spin-2", "prize_type": 2, "prize_value": 50 },
1090
+ { "request_id": "spin-3", "prize_type": 1, "prize_value": 200 }
1091
+ ]
1092
+ }
1093
+ ```
1094
+
1095
+ ---
1096
+
1097
+ ### miniGameWinAcknowledge
1098
+
1099
+ Acknowledge a mini-game win. Should be called after displaying the win result to the user.
1100
+
1101
+ #### Request
1102
+
1103
+ **ClassId:** `704` (SAW_AKNOWLEDGE_REQUEST)
1104
+
1105
+ | Field | Type | Description |
1106
+ |-------|------|-------------|
1107
+ | `cid` | `number` | `704` |
1108
+ | `uuid` | `string` | Unique request identifier |
1109
+ | `ts` | `number` | Timestamp (ms) |
1110
+ | `request_id` | `string` | Request ID from the spin response |
1111
+
1112
+ #### Response
1113
+
1114
+ **ClassId:** `705` (SAW_AKNOWLEDGE_RESPONSE)
1115
+
1116
+ | Field | Type | Description |
1117
+ |-------|------|-------------|
1118
+ | `cid` | `number` | `705` |
1119
+ | `uuid` | `string` | Request identifier |
1120
+ | `errCode` | `number` | Error code (`0` = success) |
1121
+
1122
+ ---
1123
+
1124
+ ### getMiniGamesHistory
1125
+
1126
+ Get mini-game play history.
1127
+
1128
+ #### Request
1129
+
1130
+ **ClassId:** `716` (GET_SAW_HISTORY_REQUEST)
1131
+
1132
+ | Field | Type | Description |
1133
+ |-------|------|-------------|
1134
+ | `cid` | `number` | `716` |
1135
+ | `uuid` | `string` | Unique request identifier |
1136
+ | `ts` | `number` | Timestamp (ms) |
1137
+ | `limit` | `number` | Max items to return |
1138
+ | `offset` | `number` | Offset for pagination |
1139
+ | `saw_template_id` | `number` | Filter by template ID (optional) |
1140
+
1141
+ #### Response
1142
+
1143
+ **ClassId:** `717` (GET_SAW_HISTORY_RESPONSE)
1144
+
1145
+ | Field | Type | Description |
1146
+ |-------|------|-------------|
1147
+ | `cid` | `number` | `717` |
1148
+ | `uuid` | `string` | Request identifier |
1149
+ | `errCode` | `number` | Error code (`0` = success) |
1150
+ | `history` | [`SAWPrizesHistory[]`](../interfaces/SAWPrizesHistory.md) | Array of history items |
1151
+
1152
+ ---
1153
+
1154
+ ## Tournaments
1155
+
1156
+ ### getTournamentsList
1157
+
1158
+ Get all active tournament instances.
1159
+
1160
+ #### Request
1161
+
1162
+ **ClassId:** `517` (GET_TOURNAMENT_LOBBY_REQUEST)
1163
+
1164
+ | Field | Type | Description |
1165
+ |-------|------|-------------|
1166
+ | `cid` | `number` | `517` |
1167
+ | `uuid` | `string` | Unique request identifier |
1168
+ | `ts` | `number` | Timestamp (ms) |
1169
+
1170
+ #### Response
1171
+
1172
+ **ClassId:** `518` (GET_TOURNAMENT_LOBBY_RESPONSE)
1173
+
1174
+ | Field | Type | Description |
1175
+ |-------|------|-------------|
1176
+ | `cid` | `number` | `518` |
1177
+ | `uuid` | `string` | Request identifier |
1178
+ | `errCode` | `number` | Error code (`0` = success) |
1179
+ | `tournaments` | [`Tournament[]`](../interfaces/Tournament.md) | Array of tournaments |
1180
+
1181
+ ---
1182
+
1183
+ ### getTournamentInstanceInfo
1184
+
1185
+ Get detailed information about a tournament instance including leaderboard.
1186
+
1187
+ #### Request
1188
+
1189
+ **ClassId:** `519` (GET_TOURNAMENT_INFO_REQUEST)
1190
+
1191
+ | Field | Type | Description |
1192
+ |-------|------|-------------|
1193
+ | `cid` | `number` | `519` |
1194
+ | `uuid` | `string` | Unique request identifier |
1195
+ | `ts` | `number` | Timestamp (ms) |
1196
+ | `tournament_instance_id` | `number` | Tournament instance ID |
1197
+
1198
+ #### Response
1199
+
1200
+ **ClassId:** `520` (GET_TOURNAMENT_INFO_RESPONSE)
1201
+
1202
+ | Field | Type | Description |
1203
+ |-------|------|-------------|
1204
+ | `cid` | `number` | `520` |
1205
+ | `uuid` | `string` | Request identifier |
1206
+ | `errCode` | `number` | Error code (`0` = success) |
1207
+ | `tournamentInfo` | [`GetTournamentInfoResponse.tournamentInfo`](../interfaces/GetTournamentInfoResponse.md) | Tournament info with players |
1208
+ | `userPosition` | [`TournamentPlayer`](../interfaces/TournamentPlayer.md) | Current user's position |
1209
+ | `prizeStructure` | `object` | Prize structure with `prizes` array |
1210
+
1211
+ ---
1212
+
1213
+ ### registerInTournament
1214
+
1215
+ Register user in a tournament.
1216
+
1217
+ #### Request
1218
+
1219
+ **ClassId:** `521` (TOURNAMENT_REGISTER_REQUEST)
1220
+
1221
+ | Field | Type | Description |
1222
+ |-------|------|-------------|
1223
+ | `cid` | `number` | `521` |
1224
+ | `uuid` | `string` | Unique request identifier |
1225
+ | `ts` | `number` | Timestamp (ms) |
1226
+ | `tournament_instance_id` | `number` | Tournament instance ID |
1227
+
1228
+ #### Response
1229
+
1230
+ **ClassId:** `522` (TOURNAMENT_REGISTER_RESPONSE)
1231
+
1232
+ | Field | Type | Description |
1233
+ |-------|------|-------------|
1234
+ | `cid` | `number` | `522` |
1235
+ | `uuid` | `string` | Request identifier |
1236
+ | `errCode` | `number` | Error code (`0` = success) |
1237
+ | `errMsg` | `string` | Error message (if any) |
1238
+
1239
+ ---
1240
+
1241
+ ## Leaderboard
1242
+
1243
+ ### getLeaderBoard
1244
+
1245
+ Get leaderboard for a specific period type.
1246
+
1247
+ #### Request
1248
+
1249
+ **ClassId:** `505` (GET_LEADERS_BOARD_REQUEST)
1250
+
1251
+ | Field | Type | Description |
1252
+ |-------|------|-------------|
1253
+ | `cid` | `number` | `505` |
1254
+ | `uuid` | `string` | Unique request identifier |
1255
+ | `ts` | `number` | Timestamp (ms) |
1256
+ | `period_type` | `number` | Period type: `1` = Daily, `2` = Weekly, `3` = Monthly |
1257
+ | `get_previous_period` | `boolean` | Get previous period instead of current |
1258
+
1259
+ #### Response
1260
+
1261
+ **ClassId:** `506` (GET_LEADERS_BOARD_RESPONSE)
1262
+
1263
+ | Field | Type | Description |
1264
+ |-------|------|-------------|
1265
+ | `cid` | `number` | `506` |
1266
+ | `uuid` | `string` | Request identifier |
1267
+ | `errCode` | `number` | Error code (`0` = success) |
1268
+ | `leaders` | [`LeaderBoardUserT[]`](../interfaces/LeaderBoardUserT.md) | Array of leaderboard entries |
1269
+ | `user_position` | `number` | Current user's position |
1270
+ | `user_points` | `number` | Current user's points |
1271
+
1272
+ ---
1273
+
1274
+ ## Inbox
1275
+
1276
+ ### getInboxMessages
1277
+
1278
+ Get user's inbox messages.
1279
+
1280
+ #### Request
1281
+
1282
+ **ClassId:** `513` (GET_INBOX_MESSAGES_REQUEST)
1283
+
1284
+ | Field | Type | Description |
1285
+ |-------|------|-------------|
1286
+ | `cid` | `number` | `513` |
1287
+ | `uuid` | `string` | Unique request identifier |
1288
+ | `ts` | `number` | Timestamp (ms) |
1289
+ | `from` | `number` | Start index (default 0) |
1290
+ | `to` | `number` | End index (default 20) |
1291
+ | `only_favorite` | `boolean` | Filter favorites only |
1292
+ | `category_id` | `number` | Filter by category |
1293
+ | `read_status` | `number` | Filter by read status |
1294
+
1295
+ #### Response
1296
+
1297
+ **ClassId:** `514` (GET_INBOX_MESSAGES_RESPONSE)
1298
+
1299
+ | Field | Type | Description |
1300
+ |-------|------|-------------|
1301
+ | `cid` | `number` | `514` |
1302
+ | `uuid` | `string` | Request identifier |
1303
+ | `errCode` | `number` | Error code (`0` = success) |
1304
+ | `messages` | [`InboxMessage[]`](../interfaces/InboxMessage.md) | Array of messages |
1305
+ | `unread_count` | `number` | Total unread count |
1306
+
1307
+ ---
1308
+
1309
+ ### markInboxMessageAsRead
1310
+
1311
+ Mark an inbox message as read.
1312
+
1313
+ #### Request
1314
+
1315
+ **ClassId:** `529` (MARK_INBOX_READ_REQUEST)
1316
+
1317
+ | Field | Type | Description |
1318
+ |-------|------|-------------|
1319
+ | `cid` | `number` | `529` |
1320
+ | `uuid` | `string` | Unique request identifier |
1321
+ | `ts` | `number` | Timestamp (ms) |
1322
+ | `message_guid` | `string` | Message GUID |
1323
+
1324
+ #### Response
1325
+
1326
+ **ClassId:** `530` (MARK_INBOX_READ_RESPONSE)
1327
+
1328
+ | Field | Type | Description |
1329
+ |-------|------|-------------|
1330
+ | `cid` | `number` | `530` |
1331
+ | `uuid` | `string` | Request identifier |
1332
+ | `errCode` | `number` | Error code (`0` = success) |
1333
+
1334
+ ---
1335
+
1336
+ ### markInboxMessageAsFavorite
1337
+
1338
+ Mark/unmark an inbox message as favorite.
1339
+
1340
+ #### Request
1341
+
1342
+ **ClassId:** `531` (MARK_INBOX_STARRED_REQUEST)
1343
+
1344
+ | Field | Type | Description |
1345
+ |-------|------|-------------|
1346
+ | `cid` | `number` | `531` |
1347
+ | `uuid` | `string` | Unique request identifier |
1348
+ | `ts` | `number` | Timestamp (ms) |
1349
+ | `message_guid` | `string` | Message GUID |
1350
+ | `mark` | `boolean` | `true` to add, `false` to remove |
1351
+
1352
+ #### Response
1353
+
1354
+ **ClassId:** `532` (MARK_INBOX_STARRED_RESPONSE)
1355
+
1356
+ | Field | Type | Description |
1357
+ |-------|------|-------------|
1358
+ | `cid` | `number` | `532` |
1359
+ | `uuid` | `string` | Request identifier |
1360
+ | `errCode` | `number` | Error code (`0` = success) |
1361
+
1362
+ ---
1363
+
1364
+ ### deleteInboxMessage
1365
+
1366
+ Delete an inbox message.
1367
+
1368
+ #### Request
1369
+
1370
+ **ClassId:** `535` (MARK_INBOX_DELETED_REQUEST)
1371
+
1372
+ | Field | Type | Description |
1373
+ |-------|------|-------------|
1374
+ | `cid` | `number` | `535` |
1375
+ | `uuid` | `string` | Unique request identifier |
1376
+ | `ts` | `number` | Timestamp (ms) |
1377
+ | `message_guid` | `string` | Message GUID |
1378
+
1379
+ #### Response
1380
+
1381
+ **ClassId:** `536` (MARK_INBOX_DELETED_RESPONSE)
1382
+
1383
+ | Field | Type | Description |
1384
+ |-------|------|-------------|
1385
+ | `cid` | `number` | `536` |
1386
+ | `uuid` | `string` | Request identifier |
1387
+ | `errCode` | `number` | Error code (`0` = success) |
1388
+
1389
+ ---
1390
+
1391
+ ### getInboxUnreadCount
1392
+
1393
+ Get unread inbox message count.
1394
+
1395
+ > **Note:** This uses the same ClassId as `getInboxMessages`. The unread count is returned in the `unread_count` field of the response.
1396
+
1397
+ #### Request
1398
+
1399
+ **ClassId:** `513` (GET_INBOX_MESSAGES_REQUEST)
1400
+
1401
+ | Field | Type | Description |
1402
+ |-------|------|-------------|
1403
+ | `cid` | `number` | `513` |
1404
+ | `uuid` | `string` | Unique request identifier |
1405
+ | `ts` | `number` | Timestamp (ms) |
1406
+ | `limit` | `number` | Set to `1` (minimal fetch) |
1407
+ | `offset` | `number` | Set to `0` |
1408
+
1409
+ #### Response
1410
+
1411
+ **ClassId:** `514` (GET_INBOX_MESSAGES_RESPONSE)
1412
+
1413
+ | Field | Type | Description |
1414
+ |-------|------|-------------|
1415
+ | `cid` | `number` | `514` |
1416
+ | `uuid` | `string` | Request identifier |
1417
+ | `errCode` | `number` | Error code (`0` = success) |
1418
+ | `unread_count` | `number` | Number of unread messages |
1419
+
1420
+ ---
1421
+
1422
+ ### getInboxMessageBody
1423
+
1424
+ Get the full body content of an inbox message.
1425
+
1426
+ > **Important:** This is NOT a WebSocket call. It's an HTTP GET request to the CDN.
1427
+
1428
+ #### HTTP Request
1429
+
1430
+ ```
1431
+ GET {INBOX_CDN_URL}/{message_guid}.json
1432
+ ```
1433
+
1434
+ #### Response
1435
+
1436
+ Returns JSON with full message body content.
1437
+
1438
+ ---
1439
+
1440
+ ### markAllInboxMessagesAsRead
1441
+
1442
+ Mark all inbox messages as read.
1443
+
1444
+ #### Request
1445
+
1446
+ **ClassId:** `529` (MARK_INBOX_READ_REQUEST)
1447
+
1448
+ | Field | Type | Description |
1449
+ |-------|------|-------------|
1450
+ | `cid` | `number` | `529` |
1451
+ | `uuid` | `string` | Unique request identifier |
1452
+ | `ts` | `number` | Timestamp (ms) |
1453
+ | `all_read` | `boolean` | Set to `true` |
1454
+
1455
+ #### Response
1456
+
1457
+ **ClassId:** `530` (MARK_INBOX_READ_RESPONSE)
1458
+
1459
+ | Field | Type | Description |
1460
+ |-------|------|-------------|
1461
+ | `cid` | `number` | `530` |
1462
+ | `uuid` | `string` | Request identifier |
1463
+ | `errCode` | `number` | Error code (`0` = success) |
1464
+
1465
+ ---
1466
+
1467
+ ### deleteAllInboxMessages
1468
+
1469
+ Delete all inbox messages.
1470
+
1471
+ #### Request
1472
+
1473
+ **ClassId:** `535` (MARK_INBOX_DELETED_REQUEST)
1474
+
1475
+ | Field | Type | Description |
1476
+ |-------|------|-------------|
1477
+ | `cid` | `number` | `535` |
1478
+ | `uuid` | `string` | Unique request identifier |
1479
+ | `ts` | `number` | Timestamp (ms) |
1480
+ | `all_deleted` | `boolean` | Set to `true` |
1481
+
1482
+ #### Response
1483
+
1484
+ **ClassId:** `536` (MARK_INBOX_DELETED_RESPONSE)
1485
+
1486
+ | Field | Type | Description |
1487
+ |-------|------|-------------|
1488
+ | `cid` | `number` | `536` |
1489
+ | `uuid` | `string` | Request identifier |
1490
+ | `errCode` | `number` | Error code (`0` = success) |
1491
+
1492
+ ---
1493
+
1494
+ ## Jackpots
1495
+
1496
+ ### getJackpots
1497
+
1498
+ Get all available jackpots.
1499
+
1500
+ #### Request
1501
+
1502
+ **ClassId:** `800` (JP_GET_JACKPOTS_REQUEST)
1503
+
1504
+ | Field | Type | Description |
1505
+ |-------|------|-------------|
1506
+ | `cid` | `number` | `800` |
1507
+ | `uuid` | `string` | Unique request identifier |
1508
+ | `ts` | `number` | Timestamp (ms) |
1509
+ | `jp_template_id` | `number` | Filter by template ID (optional) |
1510
+
1511
+ #### Response
1512
+
1513
+ **ClassId:** `801` (JP_GET_JACKPOTS_RESPONSE)
1514
+
1515
+ | Field | Type | Description |
1516
+ |-------|------|-------------|
1517
+ | `cid` | `number` | `801` |
1518
+ | `uuid` | `string` | Request identifier |
1519
+ | `errCode` | `number` | Error code (`0` = success) |
1520
+ | `items` | [`JackpotDetails[]`](../interfaces/JackpotDetails.md) | Array of jackpots |
1521
+
1522
+ ---
1523
+
1524
+ ### jackpotOptIn
1525
+
1526
+ Opt-in to a jackpot.
1527
+
1528
+ #### Request
1529
+
1530
+ **ClassId:** `804` (JP_OPTIN_REQUEST)
1531
+
1532
+ | Field | Type | Description |
1533
+ |-------|------|-------------|
1534
+ | `cid` | `number` | `804` |
1535
+ | `uuid` | `string` | Unique request identifier |
1536
+ | `ts` | `number` | Timestamp (ms) |
1537
+ | `jp_template_id` | `number` | Jackpot template ID |
1538
+
1539
+ #### Response
1540
+
1541
+ **ClassId:** `805` (JP_OPTIN_RESPONSE)
1542
+
1543
+ | Field | Type | Description |
1544
+ |-------|------|-------------|
1545
+ | `cid` | `number` | `805` |
1546
+ | `uuid` | `string` | Request identifier |
1547
+ | `errCode` | `number` | Error code (`0` = success) |
1548
+
1549
+ ---
1550
+
1551
+ ### jackpotOptOut
1552
+
1553
+ Opt-out from a jackpot.
1554
+
1555
+ #### Request
1556
+
1557
+ **ClassId:** `806` (JP_OPTOUT_REQUEST)
1558
+
1559
+ | Field | Type | Description |
1560
+ |-------|------|-------------|
1561
+ | `cid` | `number` | `806` |
1562
+ | `uuid` | `string` | Unique request identifier |
1563
+ | `ts` | `number` | Timestamp (ms) |
1564
+ | `jp_template_id` | `number` | Jackpot template ID |
1565
+
1566
+ #### Response
1567
+
1568
+ **ClassId:** `807` (JP_OPTOUT_RESPONSE)
1569
+
1570
+ | Field | Type | Description |
1571
+ |-------|------|-------------|
1572
+ | `cid` | `number` | `807` |
1573
+ | `uuid` | `string` | Request identifier |
1574
+ | `errCode` | `number` | Error code (`0` = success) |
1575
+
1576
+ ---
1577
+
1578
+ ### getJackpotWinners
1579
+
1580
+ Get jackpot winners history.
1581
+
1582
+ #### Request
1583
+
1584
+ **ClassId:** `809` (JP_GET_WINNERS_REQUEST)
1585
+
1586
+ | Field | Type | Description |
1587
+ |-------|------|-------------|
1588
+ | `cid` | `number` | `809` |
1589
+ | `uuid` | `string` | Unique request identifier |
1590
+ | `ts` | `number` | Timestamp (ms) |
1591
+ | `jp_template_id` | `number` | Jackpot template ID |
1592
+ | `limit` | `number` | Max items to return |
1593
+ | `offset` | `number` | Offset for pagination |
1594
+
1595
+ #### Response
1596
+
1597
+ **ClassId:** `810` (JP_GET_WINNERS_RESPONSE)
1598
+
1599
+ | Field | Type | Description |
1600
+ |-------|------|-------------|
1601
+ | `cid` | `number` | `810` |
1602
+ | `uuid` | `string` | Request identifier |
1603
+ | `errCode` | `number` | Error code (`0` = success) |
1604
+ | `winners` | [`JackpotWinnerHistory[]`](../interfaces/JackpotWinnerHistory.md) | Array of winners |
1605
+
1606
+ ---
1607
+
1608
+ ### getJackpotEligibleGames
1609
+
1610
+ Get games eligible for a specific jackpot.
1611
+
1612
+ #### Request
1613
+
1614
+ **ClassId:** `811` (JP_GET_ELIGIBLE_GAMES_REQUEST)
1615
+
1616
+ | Field | Type | Description |
1617
+ |-------|------|-------------|
1618
+ | `cid` | `number` | `811` |
1619
+ | `uuid` | `string` | Unique request identifier |
1620
+ | `ts` | `number` | Timestamp (ms) |
1621
+ | `jp_template_id` | `number` | Jackpot template ID |
1622
+
1623
+ #### Response
1624
+
1625
+ **ClassId:** `812` (JP_GET_ELIGIBLE_GAMES_RESPONSE)
1626
+
1627
+ | Field | Type | Description |
1628
+ |-------|------|-------------|
1629
+ | `cid` | `number` | `812` |
1630
+ | `uuid` | `string` | Request identifier |
1631
+ | `errCode` | `number` | Error code (`0` = success) |
1632
+ | `games` | `array` | Array of eligible game IDs |
1633
+
1634
+ ---
1635
+
1636
+ ## Raffles
1637
+
1638
+ ### getRaffles
1639
+
1640
+ Get list of Raffles available for user.
1641
+
1642
+ ### Request
1643
+
1644
+ **ClassId:** `902`
1645
+
1646
+ **Example:**
1647
+
1648
+ ```json
1649
+ {
1650
+ "cid": 902,
1651
+ "uuid": "550e8400-e29b-41d4-a716-446655440000",
1652
+ "ts": 1704067200000,
1653
+ "skip_public_meta": false
1654
+ }
1655
+ ```
1656
+
1657
+ **Fields:**
1658
+
1659
+ | Field | Type | Required | Description |
1660
+ |-------|------|----------|-------------|
1661
+ | `cid` | `number` | ✓ | Message type identifier |
1662
+ | `uuid` | `string` | ✓ | Unique request identifier |
1663
+ | `ts` | `number` | ✓ | Timestamp in milliseconds |
1664
+ | `skip_public_meta` | `boolean` | - | If `true`, response will not include `public_meta` objects (reduces payload size) |
1665
+
1666
+ ---
1667
+
1668
+ ### Response
1669
+
1670
+ **ClassId:** `903`
1671
+
1672
+ **Example:**
1673
+
1674
+ ```json
1675
+ {
1676
+ "cid": 903,
1677
+ "errCode": 0,
1678
+ "errMsg": null,
1679
+ "items": [
1680
+ {
1681
+ "raffle_id": 123,
1682
+ "public_meta": {
1683
+ "name": "Summer Raffle",
1684
+ "description": "Win amazing prizes!",
1685
+ "custom_section_id": 5,
1686
+ "image_url": "https://cdn.example.com/raffle.png",
1687
+ "image_url_mobile": "https://cdn.example.com/raffle-mobile.png",
1688
+ "hint_text": "Terms and conditions apply",
1689
+ "custom_data": "{}"
1690
+ },
1691
+ "start_date_ts": 1704067200,
1692
+ "end_date_ts": 1706745600,
1693
+ "max_tickets_count": 10000,
1694
+ "current_tickets_count": 4500,
1695
+ "draws": [
1696
+ {
1697
+ "draw_id": 1,
1698
+ "run_id": 42,
1699
+ "current_state": 1,
1700
+ "execution_type": 1,
1701
+ "execution_ts": 1704153600,
1702
+ "ticket_start_ts": 1704067200,
1703
+ "total_tickets_count": 1500,
1704
+ "my_tickets_count": 5,
1705
+ "user_opted_in": true,
1706
+ "requires_optin": false,
1707
+ "allow_multi_prize_per_ticket": false,
1708
+ "public_meta": {
1709
+ "name": "Daily Draw",
1710
+ "description": "Daily prize draw",
1711
+ "image_url": "https://cdn.example.com/draw.png",
1712
+ "is_grand": false
1713
+ },
1714
+ "prizes": [
1715
+ {
1716
+ "prize_id": "prize_1",
1717
+ "prizes_per_run": 1,
1718
+ "prizes_per_run_actual": 1,
1719
+ "chances_to_win_perc": 0.33,
1720
+ "requires_claim": true,
1721
+ "min_required_tickets_for_user": 1,
1722
+ "priority": 1,
1723
+ "should_claim": false,
1724
+ "public_meta": {
1725
+ "name": "iPhone 15",
1726
+ "description": "Brand new iPhone 15",
1727
+ "image_url": "https://cdn.example.com/iphone.png",
1728
+ "hide_chance_to_win": false
1729
+ },
1730
+ "winners": []
1731
+ }
1732
+ ],
1733
+ "my_last_tickets": [
1734
+ { "id": 12345, "s": "ABC-12345" },
1735
+ { "id": 12346, "s": "ABC-12346" }
1736
+ ]
1737
+ }
1738
+ ]
1739
+ }
1740
+ ]
1741
+ }
1742
+ ```
1743
+
1744
+ **Fields:**
1745
+
1746
+ | Field | Type | Description |
1747
+ |-------|------|-------------|
1748
+ | `cid` | `number` | Message type identifier |
1749
+ | `errCode` | `number` | Error code. `0` = success |
1750
+ | `errMsg` | `string` | Error message (if any) |
1751
+ | `items` | [`Raffle[]`](../interfaces/Raffle.md) | Array of raffles |
1752
+
1753
+ ---
1754
+
1755
+ ### Error Codes
1756
+
1757
+ | Code | Description |
1758
+ |------|-------------|
1759
+ | `0` | Success |
1760
+
1761
+ ---
1762
+
1763
+ ### getRaffleDrawRun
1764
+
1765
+ Get detailed information about a specific draw run, including winners.
1766
+
1767
+ ### Request
1768
+
1769
+ **ClassId:** `904`
1770
+
1771
+ **Example:**
1772
+
1773
+ ```json
1774
+ {
1775
+ "cid": 904,
1776
+ "uuid": "550e8400-e29b-41d4-a716-446655440000",
1777
+ "ts": 1704067200000,
1778
+ "raffle_id": 123,
1779
+ "run_id": 42,
1780
+ "winners_limit": 10,
1781
+ "winners_offset": 0
1782
+ }
1783
+ ```
1784
+
1785
+ **Fields:**
1786
+
1787
+ | Field | Type | Required | Description |
1788
+ |-------|------|----------|-------------|
1789
+ | `cid` | `number` | ✓ | Message type identifier |
1790
+ | `uuid` | `string` | ✓ | Unique request identifier |
1791
+ | `ts` | `number` | ✓ | Timestamp in milliseconds |
1792
+ | `raffle_id` | `number` | ✓ | ID of the raffle |
1793
+ | `run_id` | `number` | ✓ | ID of the specific draw run |
1794
+ | `winners_limit` | `number` | - | Maximum number of winners to return |
1795
+ | `winners_offset` | `number` | - | Offset for pagination of winners |
1796
+
1797
+ ---
1798
+
1799
+ ### Response
1800
+
1801
+ **ClassId:** `905`
1802
+
1803
+ **Example:**
1804
+
1805
+ ```json
1806
+ {
1807
+ "cid": 905,
1808
+ "errCode": 0,
1809
+ "errMsg": null,
1810
+ "draw": {
1811
+ "draw_id": 1,
1812
+ "run_id": 42,
1813
+ "current_state": 3,
1814
+ "execution_type": 1,
1815
+ "execution_ts": 1704153600,
1816
+ "ticket_start_ts": 1704067200,
1817
+ "total_tickets_count": 1500,
1818
+ "my_tickets_count": 5,
1819
+ "user_opted_in": true,
1820
+ "requires_optin": false,
1821
+ "allow_multi_prize_per_ticket": false,
1822
+ "winners_total": 3,
1823
+ "public_meta": {
1824
+ "name": "Daily Draw",
1825
+ "description": "Daily prize draw",
1826
+ "image_url": "https://cdn.example.com/draw.png",
1827
+ "is_grand": false
1828
+ },
1829
+ "prizes": [
1830
+ {
1831
+ "prize_id": "prize_1",
1832
+ "prizes_per_run": 1,
1833
+ "prizes_per_run_actual": 1,
1834
+ "chances_to_win_perc": 0,
1835
+ "requires_claim": true,
1836
+ "min_required_tickets_for_user": 1,
1837
+ "priority": 1,
1838
+ "should_claim": false,
1839
+ "public_meta": {
1840
+ "name": "iPhone 15",
1841
+ "description": "Brand new iPhone 15",
1842
+ "image_url": "https://cdn.example.com/iphone.png",
1843
+ "hide_chance_to_win": false
1844
+ },
1845
+ "winners": [
1846
+ {
1847
+ "user_id": 12345,
1848
+ "public_username": "JohnDoe",
1849
+ "avatar_id": "av_001",
1850
+ "avatar_url": "https://cdn.example.com/avatars/av_001.png",
1851
+ "ticket": { "id": 98765, "s": "WIN-98765" },
1852
+ "raf_won_id": 555,
1853
+ "claimed_date": 0
1854
+ }
1855
+ ]
1856
+ }
1857
+ ],
1858
+ "my_last_tickets": [
1859
+ { "id": 12345, "s": "ABC-12345" }
1860
+ ]
1861
+ }
1862
+ }
1863
+ ```
1864
+
1865
+ **Fields:**
1866
+
1867
+ | Field | Type | Description |
1868
+ |-------|------|-------------|
1869
+ | `cid` | `number` | Message type identifier |
1870
+ | `errCode` | `number` | Error code. `0` = success |
1871
+ | `errMsg` | `string` | Error message (if any) |
1872
+ | `draw` | [`RaffleDraw`](../interfaces/RaffleDraw.md) | Draw run details with winners |
1873
+
1874
+ ---
1875
+
1876
+ ### Error Codes
1877
+
1878
+ | Code | Description |
1879
+ |------|-------------|
1880
+ | `0` | Success |
1881
+
1882
+ ---
1883
+
1884
+ ### getRaffleDrawRunsHistory
1885
+
1886
+ Get history of completed draw runs for a specific raffle. Useful for displaying past winners and checking for unclaimed prizes.
1887
+
1888
+ ### Request
1889
+
1890
+ **ClassId:** `906`
1891
+
1892
+ **Example:**
1893
+
1894
+ ```json
1895
+ {
1896
+ "cid": 906,
1897
+ "uuid": "550e8400-e29b-41d4-a716-446655440000",
1898
+ "ts": 1704067200000,
1899
+ "raffle_id": 123,
1900
+ "draw_id": 1
1901
+ }
1902
+ ```
1903
+
1904
+ **Fields:**
1905
+
1906
+ | Field | Type | Required | Description |
1907
+ |-------|------|----------|-------------|
1908
+ | `cid` | `number` | ✓ | Message type identifier |
1909
+ | `uuid` | `string` | ✓ | Unique request identifier |
1910
+ | `ts` | `number` | ✓ | Timestamp in milliseconds |
1911
+ | `raffle_id` | `number` | ✓ | ID of the raffle |
1912
+ | `draw_id` | `number` | - | ID of specific draw. If not passed, all draw runs for the raffle will be returned |
1913
+
1914
+ ---
1915
+
1916
+ ### Response
1917
+
1918
+ **ClassId:** `907`
1919
+
1920
+ **Example:**
1921
+
1922
+ ```json
1923
+ {
1924
+ "cid": 907,
1925
+ "errCode": 0,
1926
+ "errMsg": null,
1927
+ "draw_runs": [
1928
+ {
1929
+ "draw_id": 1,
1930
+ "run_id": 42,
1931
+ "public_meta": {
1932
+ "name": "Daily Draw",
1933
+ "description": "Daily prize draw",
1934
+ "image_url": "https://cdn.example.com/draw.png",
1935
+ "is_grand": false
1936
+ },
1937
+ "execution_ts": 1704153600,
1938
+ "actual_execution_ts": 1704153605,
1939
+ "ticket_start_ts": 1704067200,
1940
+ "is_winner": true,
1941
+ "has_unclaimed_prize": true
1942
+ },
1943
+ {
1944
+ "draw_id": 1,
1945
+ "run_id": 41,
1946
+ "public_meta": {
1947
+ "name": "Daily Draw",
1948
+ "description": "Daily prize draw",
1949
+ "image_url": "https://cdn.example.com/draw.png",
1950
+ "is_grand": false
1951
+ },
1952
+ "execution_ts": 1704067200,
1953
+ "actual_execution_ts": 1704067205,
1954
+ "ticket_start_ts": 1703980800,
1955
+ "is_winner": false,
1956
+ "has_unclaimed_prize": false
1957
+ }
1958
+ ]
1959
+ }
1960
+ ```
1961
+
1962
+ **Fields:**
1963
+
1964
+ | Field | Type | Description |
1965
+ |-------|------|-------------|
1966
+ | `cid` | `number` | Message type identifier |
1967
+ | `errCode` | `number` | Error code. `0` = success |
1968
+ | `errMsg` | `string` | Error message (if any) |
1969
+ | `draw_runs` | [`RaffleDrawRun[]`](../interfaces/RaffleDrawRun.md) | Array of historical draw runs |
1970
+
1971
+ ---
1972
+
1973
+ ### Error Codes
1974
+
1975
+ | Code | Description |
1976
+ |------|-------------|
1977
+ | `0` | Success |
1978
+
1979
+ ---
1980
+
1981
+ ### claimRafflePrize
1982
+
1983
+ Claim a prize won in a raffle draw.
1984
+
1985
+ ### Request
1986
+
1987
+ **ClassId:** `908`
1988
+
1989
+ **Example:**
1990
+
1991
+ ```json
1992
+ {
1993
+ "cid": 908,
1994
+ "uuid": "550e8400-e29b-41d4-a716-446655440000",
1995
+ "ts": 1704067200000,
1996
+ "won_id": 555
1997
+ }
1998
+ ```
1999
+
2000
+ **Fields:**
2001
+
2002
+ | Field | Type | Required | Description |
2003
+ |-------|------|----------|-------------|
2004
+ | `cid` | `number` | ✓ | Message type identifier |
2005
+ | `uuid` | `string` | ✓ | Unique request identifier |
2006
+ | `ts` | `number` | ✓ | Timestamp in milliseconds |
2007
+ | `won_id` | `number` | ✓ | ID of the won prize (from `raf_won_id` in RafflePrizeWinner) |
2008
+
2009
+ ---
2010
+
2011
+ ### Response
2012
+
2013
+ **ClassId:** `909`
2014
+
2015
+ **Example:**
2016
+
2017
+ ```json
2018
+ {
2019
+ "cid": 909,
2020
+ "errCode": 0,
2021
+ "errMsg": null
2022
+ }
2023
+ ```
2024
+
2025
+ **Fields:**
2026
+
2027
+ | Field | Type | Description |
2028
+ |-------|------|-------------|
2029
+ | `cid` | `number` | Message type identifier |
2030
+ | `errCode` | `number` | Error code. `0` = success |
2031
+ | `errMsg` | `string` | Error message (if any) |
2032
+
2033
+ ---
2034
+
2035
+ ### Error Codes
2036
+
2037
+ | Code | Description |
2038
+ |------|-------------|
2039
+ | `0` | Success |
2040
+
2041
+ ---
2042
+
2043
+ ### requestRaffleOptin
2044
+
2045
+ Request opt-in for a specific raffle draw run. Used when a raffle requires explicit user opt-in before participation.
2046
+
2047
+ ### Request
2048
+
2049
+ **ClassId:** `916`
2050
+
2051
+ **Example:**
2052
+
2053
+ ```json
2054
+ {
2055
+ "cid": 916,
2056
+ "uuid": "550e8400-e29b-41d4-a716-446655440000",
2057
+ "ts": 1704067200000,
2058
+ "raffle_id": 123,
2059
+ "draw_id": 1,
2060
+ "raffle_run_id": 42
2061
+ }
2062
+ ```
2063
+
2064
+ **Fields:**
2065
+
2066
+ | Field | Type | Required | Description |
2067
+ |-------|------|----------|-------------|
2068
+ | `cid` | `number` | ✓ | Message type identifier |
2069
+ | `uuid` | `string` | ✓ | Unique request identifier |
2070
+ | `ts` | `number` | ✓ | Timestamp in milliseconds |
2071
+ | `raffle_id` | `number` | ✓ | ID of the raffle |
2072
+ | `draw_id` | `number` | ✓ | ID of the draw |
2073
+ | `raffle_run_id` | `number` | ✓ | ID of the specific draw run |
2074
+
2075
+ ---
2076
+
2077
+ ### Response
2078
+
2079
+ **ClassId:** `917`
2080
+
2081
+ **Example:**
2082
+
2083
+ ```json
2084
+ {
2085
+ "cid": 917,
2086
+ "errCode": 0,
2087
+ "errMsg": null
2088
+ }
2089
+ ```
2090
+
2091
+ **Fields:**
2092
+
2093
+ | Field | Type | Description |
2094
+ |-------|------|-------------|
2095
+ | `cid` | `number` | Message type identifier |
2096
+ | `errCode` | `number` | Error code. `0` = success |
2097
+ | `errMsg` | `string` | Error message (if any) |
2098
+
2099
+ ---
2100
+
2101
+ ## Other
2102
+
2103
+ ### getTranslations
2104
+
2105
+ Get UI translations for a specific language.
2106
+
2107
+ #### Request
2108
+
2109
+ **ClassId:** `13` (GET_TRANSLATIONS_REQUEST)
2110
+
2111
+ | Field | Type | Description |
2112
+ |-------|------|-------------|
2113
+ | `cid` | `number` | `13` |
2114
+ | `uuid` | `string` | Unique request identifier |
2115
+ | `ts` | `number` | Timestamp (ms) |
2116
+ | `lang_code` | `string` | Language code (e.g., "en", "de", "fr") |
2117
+
2118
+ #### Response
2119
+
2120
+ **ClassId:** `14` (GET_TRANSLATIONS_RESPONSE)
2121
+
2122
+ | Field | Type | Description |
2123
+ |-------|------|-------------|
2124
+ | `cid` | `number` | `14` |
2125
+ | `uuid` | `string` | Request identifier |
2126
+ | `errCode` | `number` | Error code (`0` = success) |
2127
+ | `translations` | `object` | Key-value map of translation strings |
2128
+
2129
+ #### Example
2130
+
2131
+ **Request:**
2132
+ ```json
2133
+ {
2134
+ "cid": 13,
2135
+ "uuid": "trans-123",
2136
+ "ts": 1699999999999,
2137
+ "lang_code": "en"
2138
+ }
2139
+ ```
2140
+
2141
+ **Response:**
2142
+ ```json
2143
+ {
2144
+ "cid": 14,
2145
+ "uuid": "trans-123",
2146
+ "errCode": 0,
2147
+ "translations": {
2148
+ "button.spin": "Spin Now",
2149
+ "label.points": "Points",
2150
+ "message.welcome": "Welcome!"
2151
+ }
2152
+ }
2153
+ ```
2154
+
2155
+ ---
2156
+
2157
+ ### getPointsHistory
2158
+
2159
+ Get user's points history.
2160
+
2161
+ #### Request
2162
+
2163
+ **ClassId:** `545` (GET_POINT_HISTORY_REQUEST)
2164
+
2165
+ | Field | Type | Description |
2166
+ |-------|------|-------------|
2167
+ | `cid` | `number` | `545` |
2168
+ | `uuid` | `string` | Unique request identifier |
2169
+ | `ts` | `number` | Timestamp (ms) |
2170
+ | `startTimeSeconds` | `number` | Start time (Unix timestamp in seconds) |
2171
+ | `endTimeSeconds` | `number` | End time (Unix timestamp in seconds) |
2172
+
2173
+ #### Response
2174
+
2175
+ **ClassId:** `546` (GET_POINT_HISTORY_RESPONSE)
2176
+
2177
+ | Field | Type | Description |
2178
+ |-------|------|-------------|
2179
+ | `cid` | `number` | `546` |
2180
+ | `uuid` | `string` | Request identifier |
2181
+ | `errCode` | `number` | Error code (`0` = success) |
2182
+ | `history` | `array` | Array of points history entries |
2183
+
2184
+ #### Example
2185
+
2186
+ **Request:**
2187
+ ```json
2188
+ {
2189
+ "cid": 545,
2190
+ "uuid": "hist-123",
2191
+ "ts": 1699999999999,
2192
+ "startTimeSeconds": 1699900000,
2193
+ "endTimeSeconds": 1700000000
2194
+ }
2195
+ ```
2196
+
2197
+ **Response:**
2198
+ ```json
2199
+ {
2200
+ "cid": 546,
2201
+ "uuid": "hist-123",
2202
+ "errCode": 0,
2203
+ "history": [
2204
+ { "ts": 1699950000, "points": 100, "action": "mission_complete" },
2205
+ { "ts": 1699960000, "points": 50, "action": "daily_login" }
2206
+ ]
2207
+ }
2208
+ ```
2209
+
2210
+ ---
2211
+
2212
+ ### getRelatedItemsForGame
2213
+
2214
+ Get missions and tournaments related to a specific game.
2215
+
2216
+ #### Request
2217
+
2218
+ **ClassId:** `543` (GET_RELATED_ACH_N_TOURNAMENTS_REQUEST)
2219
+
2220
+ | Field | Type | Description |
2221
+ |-------|------|-------------|
2222
+ | `cid` | `number` | `543` |
2223
+ | `uuid` | `string` | Unique request identifier |
2224
+ | `ts` | `number` | Timestamp (ms) |
2225
+ | `related_game_id` | `string` | Game ID to find related items for |
2226
+
2227
+ #### Response
2228
+
2229
+ **ClassId:** `544` (GET_RELATED_ACH_N_TOURNAMENTS_RESPONSE)
2230
+
2231
+ | Field | Type | Description |
2232
+ |-------|------|-------------|
2233
+ | `cid` | `number` | `544` |
2234
+ | `uuid` | `string` | Request identifier |
2235
+ | `errCode` | `number` | Error code (`0` = success) |
2236
+ | `achievements` | `array` | Related missions/achievements |
2237
+ | `tournaments` | `array` | Related tournaments |
2238
+
2239
+ #### Example
2240
+
2241
+ **Request:**
2242
+ ```json
2243
+ {
2244
+ "cid": 543,
2245
+ "uuid": "related-123",
2246
+ "ts": 1699999999999,
2247
+ "related_game_id": "game-456"
2248
+ }
2249
+ ```
2250
+
2251
+ **Response:**
2252
+ ```json
2253
+ {
2254
+ "cid": 544,
2255
+ "uuid": "related-123",
2256
+ "errCode": 0,
2257
+ "achievements": [
2258
+ { "ach_id": 101, "ach_name": "Play 10 rounds" }
2259
+ ],
2260
+ "tournaments": [
2261
+ { "tournament_id": 201, "tournament_name": "Weekend Cup" }
2262
+ ]
2263
+ }
2264
+ ```