Common Flows
Step-by-step walkthroughs for our most popular API use cases
1. Display a POAP Collection
You can easily fetch and display a user’s POAPs and have them available in your application for any use case.
Prerequisites
- An API key to access POAP’s API, apply for one here
- A user's Ethereum address, ENS, or email
Flow
- Use GET /actions/scan/{address} to fetch a user's POAP collection, where
address
is the Ethereum address, ENS, or email of the user you are trying to display the POAPs for.
Result
When a user logs in to your application you will be able to display their POAPs.
2. Token Gating With POAPs
By leveraging POAP, you can implement token gating using POAPs by specific Event ID. This allows only users with a POAP from a specific event to access your app, functionality, or content.
Prerequisites
- An API key to access POAP’s API, apply for one here
- An auth token to generate an access token, apply using the same link here
- A POAP event ID.
Flow
- Option 1: Use GET /actions/scan/{address}/{eventid} to see if the user's address has a POAP for the specified event ID. Using this endpoint is generally faster.
- Option 2: Use GET /actions/scan/{address} to get all the POAPs held by that address to see if the user has a POAP for the specified event ID.
- Option 3: Use GET /event/{id}/poaps to get all the wallet addresses that hold a POAP for the specified event ID.
Result
If a user has logged in with their Ethereum wallet that has a POAP from POAP event ID specified, you can grant them access.
3. Creating an Event
You can programmatically create an event using the API. This event will still need to be reviewed by the POAP Curation Body.
Prerequisites
- An API key to access POAP’s API, apply for one here
- An auth token to generate an access token, apply using the same link here
- Details of your event
Flow
- Create an event using POST /event by providing the details of the event you’d like to create.
- Please store the "secret_code" you created, as you will need this to access mint links once the request is approved
- The POAP Curation Body review can take up to 24 hours. After the event is approved, you can access mint links.
- To retrieve the claim codes, use POST /event/{id}/qr-codes. The mint links will also be sent via email.
4. Minting a POAP directly to a wallet
Prerequisites
- An API key to access POAP’s API, apply for one here
- An auth token to generate an access token, apply using the same link here
- An event has been created
- A user's Ethereum address, ENS, or email
Flow
- Use POST /event/{id}/qr-codes to get a qr_hash (claim codes) for your event.
- Use GET /actions/claim-qr and pass in a qr_hash from the previous step to get the claim secret.
- Once you have the qr_hash and the secret, you can mint the POAP to your user's Ethereum address, ENS, or email using POST /actions/claim-qr.
If you need additional claim codes, use the POST /redeem-requests endpoint.
Updated 5 months ago