# Getting Started

# Get an API key

To obtain an API key, please create an account within the OriginStamp Dashboard (opens new window). After you confirmed your registration, you can log in (opens new window) and copy your API key by clicking it in the top left corner of the OriginStamp Dashboard.

Copy your OriginStamp API key

# Using the Dashboard

After you logged in to the OriginStamp Dashboard, press the orange Timestamp now button to get to the Timestamp View.

OriginStamp Dashboard Overview

Drag a file to the dashed-bordered Timestamp Area or click it to open the file selector.

OriginStamp Dashboard Timestamp View

The file is hashed within your browser and remains on your device. Only its hash will be later transmitted to us. After the hashing is complete, the Timestamp Area contains the file information and its hash, in the following image 6c126b0cca.

OriginStamp Dashboard Timestamp View: Hashed file

Press the Timestamp Files button to submit the file hash to OriginStamp. If successful, the Timestamp Area will state New timestamp submitted as the status. If the hash was submitted before, you will see a Timestamp already submitted at dd/mm/YYYY hh:ii status instead.

OriginStamp Dashboard Timestamp View: Hash submitted

The Timestamp List Area just below the Timestamp Area contains the newly submitted timestamp. The blue icon to the left indicates that it is not yet finally included in a blockchain, but will be during the next submission.

OriginStamp Dashboard Timestamp View: Timestamp List Area

Congratulations!

You successfully created your first timestamp with OriginStamp. Check the Dashboard Guide for further steps and more details.

# Using the API

You can use the OriginStamp API with cURL or one of our client libraries. When using cURL, ensure to check our API documentation (opens new window) that describes every single endpoint.

You can also check the HowTo section for more detailed information here.

All endpoints are RESTful and expect an UTF-8 encoding and JSON payload type.

The API base url is:

https://api.originstamp.com/

When addressing the API endpoints directly with a REST call, ensure to pass the API key within the Authorization header:

curl -X POST "http://api.originstamp.com/v4/timestamp/create"\
     -H "Content-Type: application/json"
     -H "Authorization: YOUR_API_KEY"\
     -d '{"comment": "test", "hash": "2c5d36be542f8f0e7345d77753a5d7ea61a443ba6a9a86bb060332ad56dba38e"}'

A typical API response looks as follows:

{
  "error_code": 0,
  "error_message": null,
  "data": {
    "created": false,
    "date_created": 1541203188245,
    "comment": null,
    "hash_string": "2c5d36be542f8f0e7345d77753a5d7ea61a443ba6a9a86bb060332ad56dba38e",
    "timestamps": [
      {
        "seed_id": "f98a61e8-22bd-4ea5-ab9e-02723ff78c40",
        "currency_id": 0,
        "transaction": "aed3db9ef94953f65e93d56a4e5bcf234d43e27a1b3e7ce0f274cc7ed750d0e2",
        "private_key": "5e92ec09501a5d39e251a151f84b5e2228312c445eb23b4e1de6360e27bad54b",
        "timestamp": 1541203656000,
        "submit_status": 3
      }
    ]
  }
}

It contains the three properties error_code, error_message and data, where:

  • error_code is 0 if successful, else greater than 0
  • error_message is null if successful or contains a human-readable error message otherwise
  • data contains the response data if successful or null otherwise

We wrap our response data within this structure to simplify error handling instead of using HTTP status codes.

# Error handling

As long as our API is able to process your request, independent if successful or not, it returns a 200 status code. All other HTTP status codes indicate a server error or temporary unavailability.

A successful response fulfills the following criteria

  • error_code must be 0
  • error_message is null

In pseudo code, error handling could look like this:

if response.error_code == 0:
  print response.data
else:
  print "Error: %s" % response.error_message