API

Overview

Apart from the web interface, stampd.io’s blockchain stamping functionality is also possible through an API interaction.

In order to get access to our API please contact us.

The stampd.io server endpoint provides functionality for the following:

  • Authentication with our service
  • It allows posting a sha256 hash on Bitcoin’s Blockchain or on our Ethereum smart contract
  • It provides feedback on whether a SHA256 hash has been stamped on the Bitcoin or Ethereum Blockchain through stampd.io and whether the pertinent transaction has been included in a block with the appropriate confirmations

All of our endpoints return JSON objects as per the following.

Authenticate

The following endpoint is used in order to authenticate with our service. For security reasons, the third party will receive a client id and secret key which will be used in order to authenticate. Authentication is performed by maintaining this key in the request headers or by passing it as a parameter in each request.

URL: https://stampd.io/api/v2/init

Method: GET

Parameters: client_id, secret_key

Responses

Success
{ "message":"Login success", "type":"stampdAPISuccess", "session_id":"your_session_id", "code":300 }
Error
{ "message":"Invalid login credentials", "type":"stampdAPIError", "code":103 }

Post a hash on the Blockchain

The POST hash API call will post a hash on the Bitcoin Blockchain or the Ethereum smart contract.

URL: https://stampd.io/api/v2/hash

Method: POST

Parameters: hash, blockchain (BTC or ETH), session_id (optional)

Responses

Success
{ "message":"Stamping has been successfully transmitted to the Bitcoin network", "type":"stampdAPISuccess", "code":301, "stamps_remaining":10 }
Notice
{ "message":"Hash already stamped through stampd.io", "type":"stampdAPINotice", "code":202 }
Error
{ "message":"Stamping failed", "type":"stampdAPIError", "code":106 }

Check whether a hash has been posted

The GET hash API call will check whether a hash has been posted on the Bitcoin Blockchain or the Ethereum smart contract. If the transaction has been confirmed, it will return the transaction ID.

URL: https://stampd.io/api/v2/hash

Method: GET

Parameters: hash, blockchain (BTC or ETH), session_id (optional)

Responses

Success
{ "message":"Blockchain stamping confirmed with at least 2 blockchain confirmations", "type":"stampdAPISuccess", "code":302 "transactionID": ID }
Notice
{ "message":"Hash stamping confirmed to have been transmitted on the Bitcoin network through stampd.io but pertinent transaction is still pending to have 2 blockchain confirmations", "type":"stampdAPINotice", "code":201 }
Error
{ "message":"Hash has not been stamped on the blockchain through stampd.io", "type":"stampdAPIError", "code":107 }