Advanced Topics
Webhooks and Status APIs
Listen for updates in mints, edits, collection creations and other async events
Creating NFT collections and minting or editing NFTs are operations that must be sent to a blockchain. Transaction confirmation on the blockchain can take a few seconds, but during network congestion, it may take several minutes. Webhooks and the action status API allow you to stay up to date on the status of these asynchronous operations.
Some cases where you may want to listen to when transactions are confirmed include:
- Notifying your customers via email that their NFT is ready to access
- Updating your database with the NFT id for the user
- Showing in your website that that the mint has been successful
Ways to check the status of an action
Model | Best for | Mechanism |
---|---|---|
Pull (query for updates) | Quick testing | Action Status API |
Push (get notified) | Scalable apps in production | Webhooks |
Action Status APIs
Call the following API to check the status of an action:
cURL
env=<staging|www>
YOUR_API_KEY=<ENTER_YOUR_API_KEY>
actionId=<ENTER_YOUR_actionId>
curl --request GET \
--url https://${env}.crossmint.com/api/2022-06-09/actions/${actionId}\
--header 'accept: application/json' \
--header 'x-api-key: YOUR_API_KEY'