bountyblok.io
  • Documentation
  • API Reference
    • Airdrop NFT
    • Transfer HBAR
Powered by GitBook
On this page

Was this helpful?

  1. API Reference

Airdrop NFT

Airdrop an NFT

POST https://api.bountyblok.io/v1/airdrop_nft_hedera

This endpoint allows you to transfer a pre-minted or mint and transfer an NFT

Headers

Name
Type
Description

Authorization*

string

Bearer <<YOUR_API_KEY>>

Request Body

Name
Type
Description

to_address*

string

The wallet address of the recipient

token_id*

string

The token ID from which you want to airdrop NFT

serial_num

number

The serial number of the NFT to transfer. Required if transferring pre-minted NFT

metadata

string

IPFS URL containing metadata for the NFT. Required when minting new NFT Example: ipfs://bafyreia6ow6phsk7gdef6kzlgagfamxmujp47ue7rxymo6wr2qtenrzaeu/metadata.json

{
    "txs": [
        "0.0.47834406-1673375518-558564000"
    ],
    "is_valid": true
}
{
    "txs": [],
    "is_valid": false,
    "message": "Unable to execute transfers, status: InvalidNftId"
}
curl --location --request POST 'https://api.bountyblok.io/v1/airdrop_nft_hedera' \
--header 'Authorization: Bearer <<API TOKEN>>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to_address":"0.0.47879121",
    "token_id":"0.0.48484359",
    "serial_num":438
}'
var client = new RestClient("https://api.bountyblok.io/v1/airdrop_nft_hedera");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<<API TOKEN>");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@"    ""to_address"":""0.0.1113221"",
" + "\n" +
@"    ""token_id"":""0.0.1317275"",
" + "\n" +
@"    ""serial_num"":436
" + "\n" +
@"}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
var data = JSON.stringify({
  "to_address": "0.0.1113221",
  "token_id": "0.0.1317275",
  "serial_num": 436
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.bountyblok.io/v1/airdrop_nft_hedera");
xhr.setRequestHeader("Authorization", "Bearer <<API TOKEN>");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);
import http.client
import json

conn = http.client.HTTPSConnection("api.bountyblok.io")
payload = json.dumps({
  "to_address": "0.0.1113221",
  "token_id": "0.0.1317275",
  "serial_num": 436
})
headers = {
  'Authorization': 'Bearer <<API TOKEN>',
  'Content-Type': 'application/json'
}
conn.request("POST", "/v1/airdrop_nft_hedera", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.bountyblok.io/v1/airdrop_nft_hedera',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "to_address":"0.0.1113221",
    "token_id":"0.0.1317275",
    "serial_num":436
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer <<API TOKEN>',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
PreviousDocumentationNextTransfer HBAR

Last updated 2 years ago

Was this helpful?