Welcome to SCEZ! We recently launched our redesigned and enhanced portal. This blog post is about getting started with code. We have complete REST api solution for crypto developers, enthusiasts and entrepreneurs.
So if you’re a developer and wants to mint the Cardano NFTs or CNTs then you’re at right place. Let’s go through api end-points and some code snippets. We suggest you to signup and grab api key here if you’ve not done already.
Our official api doc is hosted here: https://doc.smartcontractsez.com/
Our official code samples hosted here: https://github.com/slthomason/SCEZ_code_samples
We’ll be minting using production api and Cardano mainnet network. The process is same for test network, just the base url and api key will be different. Grab the test api key from testnet portal.
There are a few pre-requisites before we get started:
We’ll try these api using Postman client. The same can be used by any client, be it dotnet, console, web, Android, iOS or any other. Feel free to contact us for any help with code samples.
Minting api is two step process as following:
Let’s check each api in detail.
POST https://api.smartcontractsez.com/api/v2/nft
{
"token_name": "MyAwesomeNFT",
"description": "This is my awesome NFT",
"wallet_passphrase": "passphrase123"
}
Response:
{
"order_id": "wyMFM6nlEz/9JnbM978QR2SPkIvrkgVdAEDZwCoP/oc=",
"msg": "Order successful"
}
As we can see, the request payload is a json object with three keys:
token_name* | string^\S*$ |
description | string or null |
wallet_passphrase* | string |
Asterisk marked keys are required input. Token name should be a valid string containing no spaces and special characters.
Wallet passphrase is the passcode you’ve set in the dashboard
Below is the screenshot to do the same in Postman:
We can do the same from any client/code. Make sure to pass the api key in header key “x-api-key” and the payload content type “application/json”
Now we’ve a order_id in response that we’ll use in next api to upload the NFT image. Image type can be jpg, png, jpeg or gif.
Form POST: https://api.smartcontractsez.com/api/v2/nft/asset/upload?order_id=wyMFM6nlEz/9JnbM978QR2SPkIvrkgVdAEDZwCoP/oc=
Response:
{
"file_name": "75-cool_bunny.png",
"status": 1
}
As we can see, this is a Form POST type api. We send the image as binary/multipart and order_id in query parameter
order_id | string |
file | string <binary> |
Below is the Postman client screensot:
If the order_id is correct and image criteria full fills, then you’ll get the response with uploaded file name.
Congratulations! We just minted our NFT in two simple steps
2021, SCEZ
You must be logged in to post a comment.