- Go to https://explorer.poetnetwork.net.
- Click on Login / Sign Up.
- Under Sign Up, enter your email address and set a password, then confirm the verification email sent to you.
- Click on Get API Token.
- Switch the toggle from Testnet to Mainnet (unless you want to use Testnet first for testing purposes).
- Click on Create API Token for Live to generate a new API Token.
- Click on the created API Token to copy it to your clipboard.
- Save the API Token in a secure place (don't share it with anyone).
- Open your command line terminal.
- Enter these two commands (replace
MY_API_TOKEN
with the API Token you copied above).
$ export API_URL="https://api.poetnetwork.net"
$ export API_TOKEN="MY_API_TOKEN"
- Register your work (replace the sample content with your own).
$ curl -H "Content-Type: application/json" -H "token: $API_TOKEN" -X POST -d \
'{
"name":"Bitcoin: A Peer-to-Peer Electronic Cash System",
"dateCreated": "2008-10-31T00:00:00.001Z",
"datePublished":"2018-10-31T12:12:12.000Z",
"author": "Satoshi Nakamoto",
"tags": "Bitcoin",
"content": "Abstract. A purely peer-to-peer version of electronic cash would allow..."
}' $API_URL/works
- The API will return a
workId
(save it for the next section).
- Retrieve your work (replace
YOUR_WORKID
with theworkId
you received above).
curl -H "Content-Type: application/json" -H "token: $API_TOKEN" -X GET $API_URL/works/YOUR_WORKID
- When you have more than one work, you can retrieve them all by leaving out the
workId
.
curl -H "Content-Type: application/json" -H "token: $API_TOKEN" -X GET $API_URL/works
Congratulations! You have successfully registered and retrieved your first claim on the Po.et Network!