Deploy an ERC721 collection contract
curl --request POST \
--url https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "MyToken",
"symbol": "MTK"
}
'import requests
url = "https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy"
payload = {
"name": "MyToken",
"symbol": "MTK"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'MyToken', symbol: 'MTK'})
};
fetch('https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'MyToken',
'symbol' => 'MTK'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy"
payload := strings.NewReader("{\n \"name\": \"MyToken\",\n \"symbol\": \"MTK\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"MyToken\",\n \"symbol\": \"MTK\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"MyToken\",\n \"symbol\": \"MTK\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 201,
"message": "Healthcheck",
"data": {
"type": "ERC721",
"deployer": "did:user:<id>",
"data": {
"contractAddress": "0xebF01265FcE347EE2161f37e49416d947C7a9590",
"name": "MyToken",
"symbol": "MTK",
"networkId": 10004
}
}
}{
"statusCode": 400,
"type": "Validation Error",
"message": "Request parameters are wrong, check requirements",
"errors": [
{
"field": "",
"error": ""
}
]
}{
"statusCode": 401,
"type": "Authentication Error"
}{
"statusCode": 403,
"type": "Forbidden Error",
"message": "Provider not available in your plan. Please, contact B-Team to include it"
}{
"statusCode": 409,
"type": "Existing Token Error",
"message": "Token with same symbol already exists"
}{
"statusCode": 429,
"type": "Out of Credits Error",
"message": "User has run out of credits. Please, contact BTeam to increase the limit"
}{
"statusCode": 500,
"type": "Internal Server Error",
"message": "Opps! Something went wrong!"
}{
"statusCode": 503,
"type": "Service Unavailable Error",
"message": "Service temporarily unavailable, please try again later"
}{
"statusCode": 504,
"type": "Gateway Timeout Error",
"message": "Impossible to mine transaction. This could be due to a rise in gas prices. Please try again"
}ERC-721
Deploy NFT Collection
Deploys an NFT collection contract with the specified characteristics.
POST
/
erc721
/
deploy
Deploy an ERC721 collection contract
curl --request POST \
--url https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "MyToken",
"symbol": "MTK"
}
'import requests
url = "https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy"
payload = {
"name": "MyToken",
"symbol": "MTK"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'MyToken', symbol: 'MTK'})
};
fetch('https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'MyToken',
'symbol' => 'MTK'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy"
payload := strings.NewReader("{\n \"name\": \"MyToken\",\n \"symbol\": \"MTK\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"MyToken\",\n \"symbol\": \"MTK\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lab.trustos.telefonicatech.com/track/v2/erc721/deploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"MyToken\",\n \"symbol\": \"MTK\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 201,
"message": "Healthcheck",
"data": {
"type": "ERC721",
"deployer": "did:user:<id>",
"data": {
"contractAddress": "0xebF01265FcE347EE2161f37e49416d947C7a9590",
"name": "MyToken",
"symbol": "MTK",
"networkId": 10004
}
}
}{
"statusCode": 400,
"type": "Validation Error",
"message": "Request parameters are wrong, check requirements",
"errors": [
{
"field": "",
"error": ""
}
]
}{
"statusCode": 401,
"type": "Authentication Error"
}{
"statusCode": 403,
"type": "Forbidden Error",
"message": "Provider not available in your plan. Please, contact B-Team to include it"
}{
"statusCode": 409,
"type": "Existing Token Error",
"message": "Token with same symbol already exists"
}{
"statusCode": 429,
"type": "Out of Credits Error",
"message": "User has run out of credits. Please, contact BTeam to increase the limit"
}{
"statusCode": 500,
"type": "Internal Server Error",
"message": "Opps! Something went wrong!"
}{
"statusCode": 503,
"type": "Service Unavailable Error",
"message": "Service temporarily unavailable, please try again later"
}{
"statusCode": 504,
"type": "Gateway Timeout Error",
"message": "Impossible to mine transaction. This could be due to a rise in gas prices. Please try again"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Network identifier where the NFT collection contract will be deployed.
Example:
10004
Body
application/json
Data needed for the deployment
Was this page helpful?
⌘I