Campaign Management
7H offers a robust API for managing interactive campaigns, providing users with engaging opportunities to participate and win exciting prizes. This API is designed to enhance user interaction and facilitate the distribution of rewards through various campaign types.
Use Cases
Prize Draws for Web3 Projects:
Description: Web3 projects can utilize 7H's Prize Draws API to organize captivating events. Participants purchase tickets using their SPL tokens for a chance to win exclusive digital collectibles like NFTs.
Event Ticketing with NFTs:
Description: Event organizers can leverage the Prize Draws API to distribute tickets for VIP passes, backstage access, or premium seating, all represented as NFTs.
E-commerce Platform Promotions:
Description: Online shopping platforms can introduce prize draws as special promotional events. Users stand a chance to win exclusive merchandise, limited-time discounts, or even a shopping spree, all presented as NFTs.
import requests
class PrizeDrawsAPI: def init(self, base_url, api_key): self.base_url = base_url self.api_key = api_key
Workflow Overview
Prize Draw Creation:
Endpoint:
/
sevenheaven/campaign/create
Description: As a campaign organizer, you can create a prize draw by specifying parameters such as ticket price, total tickets available, and the number of winners to be drawn. The API response includes essential details about the created prize draw.
Ticket Sales:
Endpoint:
/
sevenheaven/campaign/sell-tickets
Description: Participants can purchase tickets using their SPL tokens. The sevenheaven platform manages ticket sales, ensuring adherence to limits such as the maximum number of tickets per user.
Prize Drawing:
Endpoint:
/
sevenheaven/campaign/draw
Description: After the purchase period ends, the prize draw is completed, and a predetermined number of winners are selected from the pool of participating tickets. Winners are automatically awarded their prizes.
Prize Draw API Endpoints
Campaign Management
Create Campaign:
Endpoint:
/
sevenheaven/campaign/create
Description: Create a new campaign with specified parameters, including SPL token details.
Sell Tickets:
Endpoint:
/
sevenheaven/campaign/sell-tickets
Description: Enable users to purchase tickets by providing the campaign ID, user email, and the number of tickets they want to buy.
Complete Campaign:
Endpoint:
/
sevenheaven/campaign/complete
Description: Finalize the campaign to stop ticket sales. If auto-settle is enabled, the campaign will automatically move to the settling phase.
Ticket Management
Purchase Tickets:
Endpoint:
/
sevenheaven/campaign/purchase-tickets
Description: Allow users to buy tickets for a specific campaign by providing their email and the desired number of tickets.
Get Ticket Details:
Endpoint:
/
sevenheaven/campaign/ticket-details
Description: Retrieve detailed information about a specific ticket within a campaign using its unique identifier.
Campaign State Transitions
Pause, Resume, Cancel, Complete, Settle
Pause Campaign:
Endpoint:
/
sevenheaven/campaign/pause
Description: Temporarily halt a campaign, preventing further actions until resumed.
Resume Campaign:
Endpoint:
/
sevenheaven/campaign/resume
Description: Reactivate a paused campaign, allowing further actions.
Cancel Campaign:
Endpoint:
/
sevenheaven/campaign/cancel
Description: Permanently terminate a campaign. Cannot be resumed from this state.
Complete Campaign:
Endpoint:
/
sevenheaven/campaign/complete
Description: Finalize a campaign, marking it as completed. If auto-settle is true, it moves to the settling phase automatically.
Settle Campaign:
Endpoint:
/
sevenheaven/campaign/settle
Description: Settle a campaign by picking winners and distributing prizes. Async endpoint.
Ticket State Management
Get Ticket Status:
Endpoint:
/
sevenheaven/campaign/ticket-status
Description: Retrieve the status of a specific ticket within a campaign.
Requirements
SPLToken:
Create an SPL token for the campaign.
API Base URL
Base URL:
https://api.
7777.wtf/alpha/prize-draws
Additional Notes
Use start and end dates to control when a campaign starts and ends.
Disable auto-settling for more granular control over prize distribution.
This comprehensive API allows for seamless management of 7H campaigns, ensuring a dynamic and engaging experience for users participating in various prize draw scenarios.
Last updated