[Gametize Tech] API Knowledge: Minigame - Scratch Card
FeaturedData for front-end
-
Challenge ID -
long
-
Challenge title -
String
-
Challenge description -
String
-
Image (to render as background) -
String
Front-end Rendering
Initial Render
The scratch card is rendered immediately upon load, overlayed with a button. (The scratch card is not interactable at this point in time.)
User Interaction
When the user clicks on “Start scratching!”, an API call is made to generate a random result for the current user for this challenge. (Input parameters: session_key
and challenge_id
.)
https://gametize.com/api2/action/complete.json?session_key=[SESSION_KEY]&challenge_id=[CHALLENGE_ID]
You may assume that the JSON result of the above API call will be returned like this:
{
"challengeId": 3,
"code": 200,
"points": 50,
"optionId": 1005,
"optionName": "Bonus 50 points!"
}
This result will be rendered behind the “scratchable surface” of the scratch card.
Results Reveal
Subsequently, the user may interact with the scratch card by holding the mouse and hovering over the “scratchable surface” to unveil the result.
UI Workflow
Note:
The article's technical specifications and details are subject to potential changes based on our discretion. It is important to note that the information presented in the article might have become outdated or lost its relevance in the present context.
If you are interested to learn more about this, please drop an email to support@gametize.com with your queries regarding the article!
Please sign in to leave a comment.
Comments
0 comments