Quick Start

Welcome to the Zelus Labs API Quick Start Guide! By following the steps below, you can easily integrate the Zelus Labs API into your application.

Easy-Access References:

1. Obtain an API Key

Your API requests will be authenticated using an API key. Any request that doesn’t include an API key will return an error.

To get an API key, contact us - we'll also set up a direct support channel via slack, discord, or email so that you can get the help that you need in live time!

2. Verify the API Key

Once you've obtained the API key, ensure its validity by checking the status of the client's account and seeing the available contracts to work with.

curl -X GET 'https://sandbox.api.labs.zelus.io/v1/account' \
     -H "x-api-key: YOUR_API_KEY"

2.2. Get the contract to work with

curl -X GET 'https://sandbox.api.labs.zelus.io/v1/account/contracts' \
     -H "x-api-key: YOUR_API_KEY"

The result should be like this:

{
  "result":{
    "contracts":[
      {
        "id" : "contract_63b848e9-b316-48a3-adfd-065403ab88ae",
        "name" : "Smooth Collectibles (Dev) (SMOOTH)"
      }
    ]
  }
}

We will use SMOOTH contract's id (contract_63b848e9-b316-48a3-adfd-065403ab88ae) as a working one in later examples. While running those examples on your account, please use a SMOOTH contract's Id allocated for your account.

3. Create Wallets

Now, you need to register some user wallets in the system using the registerWallet API method.

3.1 Create a Wallet with an Email Address, Wallet1

Calling postWalletCreate with an email address will create a new wallet, and return the wallet address and wallet ID. If a wallet with this email already exists, it will be returned to you. For the sake of example, we will call this "Wallet1".

curl -X POST "https://sandbox.api.labs.zelus.io/v1/wallet/create" \
     -H "x-api-key: <YOUR_API_KEY>" \
     -H "Content-Type: application/json" \
     -d '{"ignoreAddress": false, "email": "email@example.com"}'

Expected result should be like this:

{
  "result": {
    "walletId":"wallet_60afcf25-2c1f-4b90-9fea-6174fd416040",
    "walletAddress":"0x0097f04ac9b2af2fb40c2c30a65023a78eaff5d6"
  }
}

3.2 Create a Wallet with a Phone Number, Wallet2

Use the same postWalletCreate API method but with a mobile number as the parameter. For the sake of example, we will call this wallet, "Wallet2".

curl -X POST "https://sandbox.api.labs.zelus.io/v1/wallet/create" \
     -H "x-api-key: <YOUR_API_KEY>" \
     -H "Content-Type: application/json" \
     -d '{"ignoreAddress": false,  "phone": "+12223334444"}'

Expected result should be like this:

{
  "result": {
    "walletId":"wallet_6e27df5e-4432-493d-ab26-b76d6c7cf18f",
    "walletAddress":"0xf32df5c3cc6f71401a0a39b49c2c07cdd01d0818"
  }
}

3.3 Create another empty wallet, Wallet3

Use the same postWalletCreate API method for empty wallet. We will call this wallet "Wallet3" later.

curl -X POST "https://sandbox.api.labs.zelus.io/v1/wallet/create" \
     -H "x-api-key: <YOUR_API_KEY>" \
     -H "Content-Type: application/json" \
     -d '{"ignoreAddress": false,  "email": "empty@example.com"}'

Expected result should be like this:

{
  "result": {
    "walletId":"wallet_922b90ea-e74e-473f-87c3-fead9b4d6506",
    "walletAddress":"0x039ea35b704890e43aa0faefc76b62405caf4656"
  }
}

4. Mint NFT Tokens

Once the wallets are registered, you can mint NFT tokens to Wallet1 and Wallet2 using the nftMint API method.

4.1. Mint an NFT for Wallet1

curl -X POST 'https://sandbox.api.labs.zelus.io/v1/nft/mint' \
     -H "x-api-key: YOUR_API_KEY" \
     -H "Content-Type: application/json" \
-d '{
  "contractId": "contract_63b848e9-b316-48a3-adfd-065403ab88ae",
  "nftTokenId": "1",
  "quantity": 1,
  "walletId": "wallet_60afcf25-2c1f-4b90-9fea-6174fd416040"
}'

Expected result should be like this:

{
  "result":{
    "id" : "task_2f42a55d-7f87-4d56-ab90-eb4cf271d8ae", 
    "status" : "finished"
  }
}

4.2. Mint an NFT for Wallet2

curl -X POST 'https://sandbox.api.labs.zelus.io/v1/nft/mint' \
     -H "x-api-key: YOUR_API_KEY" \
     -H "Content-Type: application/json" \
-d '{
  "contractId": "contract_63b848e9-b316-48a3-adfd-065403ab88ae",
  "nftTokenId": "2",
  "quantity": 1,
  "phone": "+12223334444"
}'

Expected result should be like this:

{
  "result":{
    "id" : "task_d39a93ea-e96d-4556-9147-a3bf42b422c2",
    "status":"pending"
  }
}

5. Check if a Specific NFT is in a user's wallet

Verify if the NFT tokens have been minted successfully for Wallet1 and Wallet2. To do this let's get balance for those wallets and their NFT tokens.

5.1. Check NFTs for Wallet1

curl -X GET "https://sandbox.api.labs.zelus.io/v1/wallet/nft/balance?contractId=contract_63b848e9-b316-48a3-adfd-065403ab88ae&nftTokenId=1&email=email%40example.com" \
     -H "x-api-key: YOUR_API_KEY"

Expected result should be like this:

{
  "result": {
    "value" : 1,
    "transactionStatus" : "finished"
  }
}

5.2. Check NFTs for Wallet2

curl -X GET "https://sandbox.api.labs.zelus.io/v1/wallet/nft/balance?contractId=contract_63b848e9-b316-48a3-adfd-065403ab88ae&nftTokenId=2&phone=%2B12223334444" \
     -H "x-api-key: YOUR_API_KEY"

Expected result should be like this:

{
  "result": {
    "value" : 1,
    "transactionStatus" : "finished"
  }
}

5.3. Check NFTs for Wallet3

curl -X GET "https://sandbox.api.labs.zelus.io/v1/wallet/nft/balance?contractId=contract_63b848e9-b316-48a3-adfd-065403ab88ae&nftTokenId=1&email=empty%40example.com" \
     -H "x-api-key: YOUR_API_KEY"

Expected result should be like this:

{
  "result": {
    "value" : 0
  }
}

6. Get all NFTs in a User's wallet

Ensure that Wallet1 has tokens and Wallet3 doesn't have any tokens. To do this let's get all nfts for those wallets.

6.1 For Wallet1

curl -X GET 'https://sandbox.api.labs.zelus.io/v1/wallet/nft/list?email=email@example.com' \
     -H "x-api-key: YOUR_API_KEY"

Expected result would be:

{
  "result": [
    {
      "contract": "0x509ac6e18fe97f7d96fce1a2ac3c7e6c4b9dde6d",
      "nftTokenId": "1",
      "blockchain": "polygon"
    },
    {
      "contract": "0x509ac6e18fe97f7d96fce1a2ac3c7e6c4b9dde6d",
      "nftTokenId": "2",
      "blockchain": "polygon"
    }
  ]
}

6.2 For Wallet3

Repeat the process using the Wallet3 credentials and confirm that the response indicates no minted tokens.

Conclusion

This enhanced quick start guide provides a comprehensive step-by-step approach to seamlessly integrate with the Alpha API. Ensure all API requests include the necessary authorization headers, and that you handle responses appropriately, checking for errors or necessary information.

Last updated