Create NFT on Form Submission

In this section, we'll walk through how to create an NFT with the Underdog API when someone submits the Airtable Form.

Prerequisites

Create an Airtable Form

We'll be using an Airtable form to collect emails to send claim links for our Managed NFT. We've set up an example Airtable Base and Airtable Form to use as a template. You’ll need to copy and set up the automation below or request access to copy the automation from here.

Create an NFT on Form Submission

Get the trigger to When a form is submitted which will kick off the automation when someone submits their email address.

In this automation, we'll have two steps:

  • A script to POST to the Underdog API and create a Managed NFT.

  • Update the created record from form submission with the NFT's mint address.

Here is an example script you can copy-paste into your Airtable Automation. You'll need to replace the parameters PROJECTid, NFT_NAME, and NFT_IMAGE_URL with your own data and add your Underdog API Key

const response = await fetch(

'https://dev.underdogprotocol.com/v2/projects/n/1/nfts' , 
{


method: "POST",
body: JSON.stringify ({
name: "The 1990s", 
image: "https://www.gamespot.com/a/uploads/scale_super/1562/15626911/3501525-remembering1999-movies-tv-promo.jpg",
}), 

headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer b4e9ee1d2420d0.ec947c3bfd2049059d3962e74be1959c'

}

});

const responsejson = await response.json();
output.set("mintAddress", responsejson.mintAddress) 

Last updated