Assigned Games

Get a list of eligible, expired, and played games, such as Spin the Wheel, or Scratch card, for a loyalty program member, an account, or a contact.

Resource 

1getGames(participantId:version:devMode:mockFileName:)

Signature 

1public func getGames(
2           participantId: String,
3           version: String = APIVersion.defaultVersion,
4           devMode: Bool = false,
5           mockFileName: String = "GetGames_Success"
6       ) async throws -> GameModel

Input Parameters 

ParameterTypeDescriptionRequired or Optional
devModeBooleanIndicates whether the method is run in the developer mode (true) or not (false).Optional
mockFileNameStringThe name of the file that has the sample response.Optional
participantIdStringThe ID of a loyalty program member, an account, or a contact whose eligible games are to be retrieved.Required
versionStringVersion of the API. The request body is available in version 60.0 and later.Optional

Return Value 

A GameModel instance.

1public struct GameModel : Codable

Sample Output 

1{
2   "message":null,
3   "gameDefinitions":[
4      {
5         "description":"Play Spin The Wheel to get amazing rewards",
6         "endDate":"2024-07-31T19:00:00.000Z",
7         "gameRewards":[
8            {
9               "color":"FF5733",
10               "description":"Get 10%  Off Voucher",
11               "imageUrl":null,
12               "name":"10 % Off",
13               "rewardType":"Voucher",
14               "rewardValue":null
15            },
16            {
17               "color":"000000",
18               "description":"Loyalty Points",
19               "imageUrl":null,
20               "name":"1000 Reward Points",
21               "rewardType":"LoyaltyPoints",
22               "rewardValue":"100.0"
23            },
24            {
25               "color":"762E2E",
26               "description":"Better Luck Next Time",
27               "imageUrl":null,
28               "name":"No Reward",
29               "rewardType":"NoReward",
30               "rewardValue":null
31            }
32         ],
33         "participantGameRewards":[
34            {
35               "expirationDate":"2024-01-04T20:00:00.000Z",
36               "gameParticipantRewardId":"3PRSB0000000hjJ4AQ",
37               "gameRewardId":null,
38               "issuedRewardReference":null,
39               "sourceActivity":null,
40               "status":"YetToReward"
41            }
42         ],
43         "name":"Spin The Wheel",
44         "startDate":"2023-10-01T19:00:00.000Z",
45         "timeoutDuration":10,
46         "type":"SpintheWheel"
47      },
48      {
49         "description":"Play Scratch card to get amazing rewards",
50         "endDate":"2024-07-31T19:00:00.000Z",
51         "gameRewards":[
52                        {
53               "color":"",
54               "description":"Get 10%  Off Voucher",
55               "imageUrl":null,
56               "name":"10 % Off",
57               "rewardType":"Voucher",
58               "rewardValue":null
59            },
60            {
61               "color":"",
62               "description":"Better Luck Next Time",
63               "imageUrl":null,
64               "name":"No Reward",
65               "rewardType":"NoReward",
66               "rewardValue":null
67            }
68         ],
69         "participantGameRewards":[
70            {
71               "expirationDate":"2024-01-04T20:00:00.000Z",
72               "gameParticipantRewardId":"2ABSB0000000hjJ3AM",
73               "gameRewardId":"2GRSB0000000Caf4AB",
74               "issuedRewardReference":"0lVSB000000032j2AA",
75               "sourceActivity":"0c85i0000009c6D",
76               "status":"Rewarded"
77            }
78         ],
79         "name":"Scratch Card",
80         "startDate":"2023-10-01T19:00:00.000Z",
81         "timeoutDuration":20,
82         "type":"Scratchcard"
83      }
84   ],
85   "status":true
86}

Output Parameters 

Property NameTypeDescriptionFilter Group and VersionAvailable Version
messageStringMessage that provides the reason why a list of games weren’t found for the participant.Small, 60.060.0
gameDefinitionsGameDefinition[] Small, 60.060.0
statusBooleanIndicates whether the request succeeded (true) or failed (false).Small, 60.060.0

List of game definitions associated with the games assigned to the member. A game definition has the details of a game, including:

  • The list of possible rewards for the game.
  • The participant game reward records that contain details of the game reward the participant has won for each game play, or can win after playing the game.
Property NameTypeDescriptionFilter Group and VersionAvailable Version
descriptionStringDescription of the game.Small, 60.060.0
endDateStringDate until which participants are eligible to play the game.Small, 60.060.0
gameDefinitionIdStringID of the game definition associated with the game.Small, 60.060.0
gameRewardsGameReward []List of possible rewards for a game.Small, 60.060.0
nameStringName of the game definition.Small, 60.060.0
participantGameRewardsParticipantGameReward[]List of participant game reward records that contain the details of the game reward the participant has won for each game play, or can win after playing the game.Small, 60.060.0
startDateStringDate from which participants are eligible to play the game.Small, 60.060.0
timeoutDurationIntegerDuration of the game in seconds before the game session times out.Small, 60.060.0
typeStringType of the game. Possible values are Scratchcard or SpintheWheel.Small, 60.060.0
Property NameTypeDescriptionFilter Group and VersionAvailable Version
colorStringColor of the segment in the Spin the Wheel game that represents the game reward.Small, 60.060.0
descriptionStringDescription of the game reward.Small, 60.060.0
imageUrlStringImage URL of the segment in the Spin the Wheel game that represents the game reward.Small, 60.060.0
nameStringName of the game reward.Small, 60.060.0
gameRewardIdStringID of the game reward.Small, 60.060.0
rewardTypeStringType of the game reward. Possible values are CustomReward, LoyaltyPoints, NoReward, Raffle, or Voucher.Small, 60.060.0
rewardValueStringValue of the voucher, or the number of points to credit as a game reward to participants.Small, 60.060.0
Property NameTypeDescriptionFilter Group and VersionAvailable Version
expirationDateStringDate until which the game reward is valid.Small, 60.060.0
gameParticipantRewardIdStringID of the participant game reward object.Small, 60.060.0
gameRewardIdStringID of the game reward won. This field is null for a game yet to be played.Small, 60.060.0
issuedRewardReferenceStringVoucher ID, or the transaction journal ID associated with the voucher, or the loyalty points rewarded to the participant. This field is null for a game yet to be played.Small, 60.060.0
sourceActivityStringID of the promotion, or the transaction journal that is associated with the activity because of which the participant was eligible to play the game. Examples of source activities include purchasing a product, and reviewing on social media. This field is null for a game yet to be played.Small, 60.060.0
statusStringStatus of the reward. Possible values are Expired, NoReward, Rewarded, or YetToReward.Small, 60.060.0