Skip to content

REST API


Mainnet REST API Endpoint:

https://api.secrether.io/

Ropsten Testnet REST API Endpoint:

https://ropsten-api.secrether.io/


[POST] Create Secret

https://api.secrether.io/v1/secret/create

Creates a secret record and saves secret data off-chain. This method must be called after Ethereum API Create Secret Method.

Parameters
  • hash string - A keccak256 hash of the secret data string
  • data string - Secret data string
Request
{
  "hash": "0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8",
  "data": "hello"
}
Response
200
{
    "status": 200,
    "data": {
        "hash": "0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8",
        "size": 5
    }
}
500
{
    "status": 500,
    "error": "Error message"
}

[Get] OTA

https://api.secrether.io/v1/secret/ota

To retrieve the secret consumer must be permitted via Ethereum API Add Permissions Method by the secret's owner or the secret could be publicated by the secret's owner via Ethereum API Make Public Method, then receive a one-time-authentication (OTA) through this method, sign it and send the result to the Get Secret Method below (see Tutorial).

* Note: OTA Code times out after 10 minutes from the time of its issue. It is more than enough to run the code that makes the set of authentication calls and enough for manual testing too. If this time may have passed, please make sure to get a new OTA Code.

Response
200
{
    "status": 200,
    "data": {
        "ota": "8hlv9kEddcVPm3Mu5fBsPpDZWsiZ3op0"
    }
}
500
{
    "status": 500,
    "error": "Error message"
}

[Get] Secret

https://api.secrether.io/v1/secret/get

Retrieve the secret. Is used by consumer.

Parameters
  • hash string - A keccak256 hash of the secret data string
  • ota string - The OTA from Get OTA Method
  • sign string - ECDSA OTA Code Sign with permitted consumer address (see Tutorial)
Request
{
  "hash": "0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8",
  "ota": "sw5TC2lLvXqeEsEke5VXRlYdMSLi8Gwf",
  "sign": "0xeb0b7c925eba830f0b8e395117ea1ca622a0279651cd64a9d5bb78e9a215c38a059e5b90b68bbec6ab83e430278e1e40111fb69219f948d8ee1969866fa9df3c1b"
}
Response
200
*** SECRET DATA ***
500
{
    "status": 500,
    "error": "Error message"
}

[Get] Public Secret

https://api.secrether.io/v1/secret/getPublic

Get an already published secret by anyone. * Note: Point Provable API to this url to get the secret data to your smart contract.

Parameters
  • hash string - A keccak256 hash of the secret data string
  • ota string - The OTA from Get OTA Method
  • sign string - ECDSA OTA Code Sign with permitted consumer address (see Tutorial)
Request
{
  "hash": "0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8",
  "ota": "sw5TC2lLvXqeEsEke5VXRlYdMSLi8Gwf",
  "sign": "0xeb0b7c925eba830f0b8e395117ea1ca622a0279651cd64a9d5bb78e9a215c38a059e5b90b68bbec6ab83e430278e1e40111fb69219f948d8ee1969866fa9df3c1b"
}
Response
200
*** SECRET DATA ***
500
{
    "status": 500,
    "error": "Error message"
}