API Documentation

Discover how to use OYB's API to automate your process and validate the documents on the blockchain, providing the user a timestamp proof of the document's existence.

Introduction

The OYB’s API allows you to automate your operations by validating documents, checking their existence in the Ethereum blockchain and invalidating them. By using the API, you will never have to submit your files, instead you will have to send a SHA-256 hash of the file(s). The hash is the only information stored on the blockchain, and allows other people to find out if your file actually existed in a period of time.

Example

Let’s say you are writing a book – and before selling it – somebody steals the content of your book to sell it on his own. How could you prove the original book was written by you? OYB allows you to do that.

Authentication

In order to send API requests you need to create an API Key.
For tests you can create a free API key by clicking here. Registration is needed.

The API Key has to be placed inside an HTTP header named OYB-API-Key.

A free account allows you to operate only on the Ethereum’s “Rinkeby” Testnet, with strict restrictions.

URL

The URL to use in order to send an API request is the following:
https://api.ownyourbusiness.tech/{network}/{method}

Currently, there are two available networks: rinkeby, mainnet.
OYB API interacts through POST and GET requests, no other HTTP methods are involved.

Validation

Endpoint

[POST] /{network}/validate

Request body

The request must be sent as type application/json.

{
  "checksum": "string",
  "contractAddress": "string"
}

Parameters

  • checksum*: the checksum of the file(s) you need to validate.
  • contractAddress: the smart contract address, in case you want to use a particular smart contract.

* required

Response


{
    "transactionHash": "string",
    "smartContract": "string"
}

Invalidation

Endpoint

[POST] /{network}/invalidate

Request body

The request must be sent as type application/json.

{
  "oldChecksum": "string",
  "newChecksum": "string",
  "contractAddress": "string"
}

Parameters

  • oldChecksum*: the checksum of the no longer valid file.
  • newChecksum*: the checksum of the valid file.
  • contractAddress: the smart contract address, in case you want to use a particular smart contract.

* required

Attention: you cannot invalidate files validated by others. You cannot invalidate a file if the smart contract is different. The new file must already be validated.

Response


{
    "transactionHash": "string",
    "smartContract": "string"
}

Verification

Endpoint

[GET] /{network}/check

Parameters

  • hash*: the hash you want to verify.
  • * required

    Response

    
    {
        "found": true,
        "contractAddress": "string",
        "validatedBy": "string",
        "network": "string",
        "invalidated": true,
        "validatedAt": 0,
        "invalidatedAt": 0
    }
    
    

    validatedBy and invalidatedBy are UNIX timestamps.