Promotion API Examples
This document provides practical examples of using the Main App Promotion API for common use cases.
Basic Queries​
Fetch All Promotions​
query GetAllPromotions {
promotions(limit: 10, offset: 0) {
count
data {
id
name
description
slug
category
type
imageUrl
altText
primaryButton {
text
action {
modal
externalUrl
internalUrl
}
}
seo {
title
description
socialImage
}
isClaimed
isClicked
usersClaimed {
count
sampleUsers {
id
avatarUrl
}
}
}
limit
offset
}
}
Fetch Single Promotion by Slug​
query GetPromotionBySlug($slug: String!) {
promotion(slug: $slug) {
id
name
description
slug
category
type
imageUrl
altText
backgroundColor
primaryButton {
text
action {
modal
externalUrl
internalUrl
}
}
secondaryButton {
action {
modal
externalUrl
internalUrl
}
}
howItWorks {
steps
longDescription
terms
}
seo {
title
description
socialImage
}
slider {
name
title
description
imageUrl
btnText
link
actionType
initialClickCount
}
popup {
name
title
description
imageUrl
btnText
link
actionType
layout
initialClickCount
}
videoSlider {
name
title
description
videoUrl
btnText
link
actionType
initialClickCount
}
isClaimed
isClicked
usersClaimed {
count
sampleUsers {
id
avatarUrl
}
}
remainedSecondsToOptIn
}
}
Filtered Queries​
Fetch Casino Promotions​
query GetCasinoPromotions {
promotions(
category: CASINO
limit: 5
offset: 0
order: DESC
orderBy: CREATED_AT
) {
count
data {
id
name
description
category
imageUrl
primaryButton {
text
action {
modal
}
}
isClaimed
}
limit
offset
}
}
Fetch Big Promotions Only​
query GetBigPromotions {
promotions(type: BIG, limit: 3, offset: 0) {
count
data {
id
name
description
type
howItWorks {
steps
longDescription
terms
}
secondaryButton {
action {
modal
}
}
}
}
}
Slider Queries​
Fetch Home Page Sliders​
query GetHomeSliders {
sliders(
category: CASINO
sliderCategory: HOME_PAGE
limit: 5
offset: 0
order: ASC
) {
count
data {
id
name
description
slug
slider {
name
title
description
imageUrl
btnText
link
actionType
initialClickCount
}
primaryButton {
text
action {
modal
}
}
isClaimed
isClicked
}
limit
offset
}
}
Fetch Casino Lobby Sliders​
query GetCasinoLobbySliders {
sliders(
category: CASINO
sliderCategory: CASINO_LOBBY
limit: 10
offset: 0
) {
count
data {
id
slug
slider {
title
description
imageUrl
actionType
initialClickCount
}
isClaimed
}
}
}
Popup Queries​
Fetch Active Popups​
query GetActivePopups {
popups(category: CASINO, popupCategory: POPUP, limit: 3, offset: 0) {
count
data {
id
name
description
popup {
name
title
description
imageUrl
btnText
link
actionType
layout
initialClickCount
}
primaryButton {
text
action {
modal
}
}
isClaimed
}
}
}
Fetch Notification Popups​
query GetNotificationPopups {
popups(category: GENERAL, popupCategory: NOTIFICATION, limit: 5, offset: 0) {
count
data {
id
popup {
title
description
layout
actionType
}
primaryButton {
text
action {
modal
}
}
}
}
}
Video Slider Queries​
Fetch Casino Explore Videos​
query GetCasinoExploreVideos {
videoSliders(
category: CASINO
videoSliderCategory: CASINO_EXPLORE
limit: 4
offset: 0
) {
count
data {
id
name
description
videoSlider {
name
title
description
videoUrl
btnText
link
actionType
initialClickCount
}
primaryButton {
text
action {
modal
}
}
isClaimed
isClicked
}
}
}
Fetch Sports Explore Videos​
query GetSportsExploreVideos {
videoSliders(
category: SPORTS
videoSliderCategory: SPORTS_EXPLORE
limit: 3
offset: 0
) {
count
data {
id
videoSlider {
title
description
videoUrl
actionType
}
isClaimed
}
}
}
User Interaction Examples​
Check if User Claimed Promotion​
query CheckUserClaim($slug: String!) {
promotion(slug: $slug) {
id
name
isClaimed
primaryButton {
text
action {
modal
}
}
remainedSecondsToOptIn
}
}
Get User Engagement Data​
query GetEngagementData($slug: String!) {
promotion(slug: $slug) {
id
name
isClaimed
isClicked
usersClaimed {
count
sampleUsers {
id
avatarUrl
}
}
slider {
initialClickCount
}
popup {
initialClickCount
}
videoSlider {
initialClickCount
}
}
}