API Documentation
Identity
- POSTCreate user device
- GETGet user metadata
- POSTCreate user metadata
- GETGet users
- GETUser count
- POSTConnect a user to User Group
- POSTDisconnect a user from User Group
- GETConnect Auth
- POSTPost apiusersverify
- GETGet all website user attributes
- POSTCreate a new website user attribute
- DELDelete a website user attribute
- GETGet all website user attribute values
- POSTCreate a new website user attribute value
Loyalty
- GETGet loyalty accounts
- GETGet the rank of a user based on their loyalty points
- GETGet loyalty currencies
- POSTCreate a loyalty currency
- GETGet Loyalty Multipliers
- POSTCreate Loyalty Multiplier
- DELDelete Loyalty Multiplier by External Identifier
- POSTUpdate Loyalty Multiplier
- DELDelete Loyalty Multiplier by ID
- GETGet Loyalty Rule Edits
- POSTRestore Loyalty Rule Edit
- GETGet Loyalty Rule Groups
- POSTCreate Loyalty Rule Groups
- POSTUpdate Loyalty Rule Group
- DELDelete Loyalty Rule Group
- GETGet Loyalty Rules
- POSTCreate Loyalty Rule
- POSTUpdate Loyalty Rule
- DELDelete Loyalty Rule
- POSTComplete Loyalty Rule
- GETGet Processing status for a specific user on loyalty rules
- POSTCreate Loyalty Transaction
- GETGet Loyalty Transaction Entries
- GETGet Loyalty Rule Chains
- GETGet Loyalty Rule Statuses
- POSTUpdate Loyalty Rule Status
Badge
Minting
Question
Website
Landing Page
Get Loyalty Rule Groups
Retrieve configured loyalty rule groups
import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});
async function main() {
const response = await client.loyalty.ruleGroups.getRuleGroups();
console.log(response.data);
}
main();
{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"isRequired": true,
"sortId": 123,
"isCollapsible": true,
"subTitle": "<string>",
"loyaltyGroupItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sortId": 123,
"loyaltyRule": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"isRequired": true,
"deletedAt": "2023-11-07T05:31:56Z",
"loyaltyCurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "Bonus",
"amount": 123,
"hideInUi": true,
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"rewardType": "points",
"frequency": "none",
"metadata": {
"onlyNonListed": true,
"hasPaidFullRoyalty": false,
"hasVerifiedTwitter": true,
"onlyRewardExistingUser": true,
"hasNeverSold": false,
"onlyNative": true,
"hasFillSource": true,
"fillSource": "opensea.io",
"hasOrderSource": true,
"orderSource": "opensea.io",
"twitterUsername": "@example_user",
"twitterUserId": "1234567890",
"twitterHashtag": "#loyalty",
"enableVerifiedMultiplier": true,
"verifiedMultiplier": 1.5,
"isMultiplierApplied": true,
"onlyKnownUsers": false,
"firstReferralReward": 10,
"referrerReward": 50,
"secondReferralReward": 5,
"enableStreaks": true,
"promoCode": "PROMO123",
"enableJoinDiscordServers": true,
"discordServersToJoin": [
{
"id": "123456789012345678",
"channels": [
{
"id": "987654321098765432",
"text": "Hello",
"emojis": [
{
"id": "1f600"
}
]
}
],
"roles": [
{
"id": "role123"
}
]
}
],
"streakArray": [
{
"streakMilestone": 5,
"streakAmount": 10
}
],
"dripQuestsToComplete": [
{
"id": "drip123"
}
],
"collection": [
{
"address": "0xabcdefabcdefabcdefabcdefabcdefabcdef",
"network": "mainnet",
"multiplier": 2
}
],
"range": [
{
"startRange": 1,
"endRange": 10,
"amount": 5
}
],
"customRewardsApiKey": "api-key-1234",
"link": "https://example.com",
"socialPlatform": "X(Twitter)",
"socialPlatformName": "Twitter",
"socialPlatformLogo": "https://example.com/logo.png",
"rewardPerImpression": true,
"minQty": 1,
"maxQty": 10,
"snapshotProposals": [
{
"id": "proposal123",
"space": "space123"
}
],
"cta": {
"label": "Click Here",
"href": "https://example.com"
},
"hasSaleCurrency": false,
"isTokenHoldMultiplier": true,
"saleCurrency": "USD",
"isRetroactive": true,
"timeDelayToVerifySeconds": 300,
"referralRequirements": {
"points": {
"amount": 50,
"loyaltyCurrecyId": "currency123"
},
"achievePoints": true,
"completeProfile": false,
"connectTwitter": true,
"connectDiscord": true,
"connectEmail": true
},
"multiplierLoyaltyCurrencyIds": [
"currency123",
"currency456"
],
"verifyPlaceHolderText": "Enter your verification code here.",
"verificationTextMinimumLength": 10,
"buttonText": "Verify Now",
"telegramChannelId": "telegram-channel-123",
"twitterAccountUrl": "https://twitter.com/example_user",
"twitterPostUrl": "https://twitter.com/example/status/1234567890",
"checkLike": true,
"checkRepost": true,
"checkComment": true,
"checkText": "loyalty",
"smartContract": {
"contractId": "123e4567-e89b-12d3-a456-426614174000",
"abi": "[]",
"event": "Transfer",
"criteria": "everyEvent",
"params": [
{
"name": "value",
"condition": ">=",
"value": "100"
}
],
"withCustomRange": true,
"customRange": {
"startsAt": "2024-01-01T00:00:00Z",
"endsAt": "2024-01-31T23:59:59Z"
},
"withMax": true,
"max": 1000,
"withBonus": true,
"bonus": [
{
"amount": 50,
"count": 5
}
],
"addressMapping": "0x123...789"
},
"walletType": "evm",
"imageUrl": "https://example.com/image.png",
"trackAllContracts": true,
"onlyRewardSingleTokenOwnership": true,
"skipMultiplier": true,
"completeProfileConditions": {
"twitter": true,
"discord": false
},
"steamAppId": "1234567890",
"trackProgress": true
},
"mediaUrl": "<string>"
}
}
]
}
],
"hasNextPage": true
}
Authorizations
Query Parameters
1 <= x <= 1000
Response
Schema for a get loyalty rule groups response
Bonus
, BoughtOn
, BoughtWithRoyalties
, DiscordMessages
, Listing
, Lodging
, MintOn
, PoapClaim
, SnagSocialsConnected
, SnapshotFullset
, SnapshotHold
, SoldOn
, SoldWithRoyalties
, TokenHold
, TwitterBio
, TwitterHashTagPost
, Retweet
, check_in
, code_entry
, connect_wallet
, connected_discord
, connected_email
, connected_epic
, connected_steam
, connected_telegram
, connected_twitter
, create_partner_account
, discord_member
, drip_x_follow
, drip_x_new_tweet
, drip_x_text_in_bio
, drip_x_text_in_comment
, drip_x_text_in_name
, drip_x_tweet
, external_rule
, link_click
, manual_upload
, profile_completed
, referred_user
, smart_contract_event
, snapshot_governance
, telegram_join
, telegram_messages
, text_input
, token_hold_erc20
, tweet_liked_by_project
, twitter_comment
, twitter_follow
, twitter_followers
, twitter_like
, twitter_post_hashtag
, quiz
, poll
, steam_wishlist
points
, multiplier
none
, once
, daily
, weekly
, monthly
, immediately
Flag indicating whether to include only non-listed items.
true
Indicates if the full royalty has been paid for items.
false
Indicates if the user has a verified Twitter account.
true
Indicates if only existing users are rewarded.
true
Indicates if the item has never been sold.
false
Flag indicating whether to include only native tokens.
true
Flag indicating whether the fill source is included.
true
Fill source of the order for the token sale
"opensea.io"
Flag indicating whether the order source is included.
true
Order source of the order for the token sale
"opensea.io"
Twitter username of the user.
"@example_user"
Unique identifier of the Twitter user.
"1234567890"
Hashtag associated with the Twitter post.
"#loyalty"
Flag indicating whether the verified multiplier is enabled.
true
Multiplier applied to rewards for verified users.
1.5
Indicates if the multiplier has been applied to rewards.
true
Flag indicating whether to include only known users.
false
Percentage reward given to a user for their first referral.
10
Lump sum reward given to a referrer.
50
Percentage reward given for a second-level referral.
5
Flag indicating whether streaks are enabled.
true
Promotional code associated with the rule.
"PROMO123"
Flag indicating whether joining Discord servers is required.
true
Array of Discord servers, channels, and roles to join.
Array of streak milestones and corresponding rewards.
Array of drip quests required to complete the rule.
Array of collections associated with the rule.
Array defining ranges and corresponding rewards.
API key for custom rewards integration.
"api-key-1234"
Optional link associated with the metadata.
"https://example.com"
Social media platform associated with the rule.
Custom
, Discord
, EpicGames
, Instagram
, Steam
, Telegram
, TikTok
, Twitch
, X(Twitter)
, YouTube
"X(Twitter)"
Name of the social platform.
"Twitter"
URL of the social platform's logo.
"https://example.com/logo.png"
Flag indicating if rewards are given per impression.
true
Minimum quantity constraint for token holding.
1
Maximum quantity constraint for token holding.
10
Array of snapshot proposals for the rule.
Object containing details for the call-to-action.
Flag indicating if the sale currency is included.
false
Flag indicating if the token hold multiplier is applied.
true
Currency associated with sales.
"USD"
Flag indicating if rewards are applied retroactively.
true
Time delay in seconds to verify actions.
300
Object defining referral requirements.
Array of loyalty currency IDs used for multipliers.
["currency123", "currency456"]
Placeholder text for verification input fields.
"Enter your verification code here."
Minimum length of the verification text.
10
Text displayed on the action button.
"Verify Now"
ID of the Telegram channel.
"telegram-channel-123"
URL of the associated Twitter account.
"https://twitter.com/example_user"
URL of the associated Twitter post.
"https://twitter.com/example/status/1234567890"
Flag indicating if liking the post is required.
true
Flag indicating if reposting is required.
true
Flag indicating if commenting is required.
true
Text to check in the Twitter post, username, or bio.
"loyalty"
Object containing details of the associated smart contract.
Type of wallet associated with the rule.
evm
, solana
, imx
, sui
, ton
"evm"
URL of the image associated with the rule.
"https://example.com/image.png"
Flag indicating if all contracts are tracked.
true
give points for only one token ownership per contract
true
Flag indicating if the multiplier is skipped.
true
Conditions for completing the profile.
{ "twitter": true, "discord": false }
ID of the Steam app.
"1234567890"
Flag indicating if the progress is tracked. If enabled, the rule can only be completed once the progress is 100%.
true
Was this page helpful?
import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});
async function main() {
const response = await client.loyalty.ruleGroups.getRuleGroups();
console.log(response.data);
}
main();
{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"isRequired": true,
"sortId": 123,
"isCollapsible": true,
"subTitle": "<string>",
"loyaltyGroupItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sortId": 123,
"loyaltyRule": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"isRequired": true,
"deletedAt": "2023-11-07T05:31:56Z",
"loyaltyCurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "Bonus",
"amount": 123,
"hideInUi": true,
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"rewardType": "points",
"frequency": "none",
"metadata": {
"onlyNonListed": true,
"hasPaidFullRoyalty": false,
"hasVerifiedTwitter": true,
"onlyRewardExistingUser": true,
"hasNeverSold": false,
"onlyNative": true,
"hasFillSource": true,
"fillSource": "opensea.io",
"hasOrderSource": true,
"orderSource": "opensea.io",
"twitterUsername": "@example_user",
"twitterUserId": "1234567890",
"twitterHashtag": "#loyalty",
"enableVerifiedMultiplier": true,
"verifiedMultiplier": 1.5,
"isMultiplierApplied": true,
"onlyKnownUsers": false,
"firstReferralReward": 10,
"referrerReward": 50,
"secondReferralReward": 5,
"enableStreaks": true,
"promoCode": "PROMO123",
"enableJoinDiscordServers": true,
"discordServersToJoin": [
{
"id": "123456789012345678",
"channels": [
{
"id": "987654321098765432",
"text": "Hello",
"emojis": [
{
"id": "1f600"
}
]
}
],
"roles": [
{
"id": "role123"
}
]
}
],
"streakArray": [
{
"streakMilestone": 5,
"streakAmount": 10
}
],
"dripQuestsToComplete": [
{
"id": "drip123"
}
],
"collection": [
{
"address": "0xabcdefabcdefabcdefabcdefabcdefabcdef",
"network": "mainnet",
"multiplier": 2
}
],
"range": [
{
"startRange": 1,
"endRange": 10,
"amount": 5
}
],
"customRewardsApiKey": "api-key-1234",
"link": "https://example.com",
"socialPlatform": "X(Twitter)",
"socialPlatformName": "Twitter",
"socialPlatformLogo": "https://example.com/logo.png",
"rewardPerImpression": true,
"minQty": 1,
"maxQty": 10,
"snapshotProposals": [
{
"id": "proposal123",
"space": "space123"
}
],
"cta": {
"label": "Click Here",
"href": "https://example.com"
},
"hasSaleCurrency": false,
"isTokenHoldMultiplier": true,
"saleCurrency": "USD",
"isRetroactive": true,
"timeDelayToVerifySeconds": 300,
"referralRequirements": {
"points": {
"amount": 50,
"loyaltyCurrecyId": "currency123"
},
"achievePoints": true,
"completeProfile": false,
"connectTwitter": true,
"connectDiscord": true,
"connectEmail": true
},
"multiplierLoyaltyCurrencyIds": [
"currency123",
"currency456"
],
"verifyPlaceHolderText": "Enter your verification code here.",
"verificationTextMinimumLength": 10,
"buttonText": "Verify Now",
"telegramChannelId": "telegram-channel-123",
"twitterAccountUrl": "https://twitter.com/example_user",
"twitterPostUrl": "https://twitter.com/example/status/1234567890",
"checkLike": true,
"checkRepost": true,
"checkComment": true,
"checkText": "loyalty",
"smartContract": {
"contractId": "123e4567-e89b-12d3-a456-426614174000",
"abi": "[]",
"event": "Transfer",
"criteria": "everyEvent",
"params": [
{
"name": "value",
"condition": ">=",
"value": "100"
}
],
"withCustomRange": true,
"customRange": {
"startsAt": "2024-01-01T00:00:00Z",
"endsAt": "2024-01-31T23:59:59Z"
},
"withMax": true,
"max": 1000,
"withBonus": true,
"bonus": [
{
"amount": 50,
"count": 5
}
],
"addressMapping": "0x123...789"
},
"walletType": "evm",
"imageUrl": "https://example.com/image.png",
"trackAllContracts": true,
"onlyRewardSingleTokenOwnership": true,
"skipMultiplier": true,
"completeProfileConditions": {
"twitter": true,
"discord": false
},
"steamAppId": "1234567890",
"trackProgress": true
},
"mediaUrl": "<string>"
}
}
]
}
],
"hasNextPage": true
}