# From 0 to 1

## General Information

### 🔗 BASE URL <a href="#id-815f8d14-8bc7-45ee-a937-263ea95ce04c" id="id-815f8d14-8bc7-45ee-a937-263ea95ce04c"></a>

<https://api.uproofs.apio.cc>

### 🔑 AUTHORIZATION <a href="#id-92d53a87-456d-4ef9-98b5-bca0930faf16" id="id-92d53a87-456d-4ef9-98b5-bca0930faf16"></a>

You can use your API KEY putting it inside the header

```
"Authorization": "apikey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```

## 👤 Create an Identity

### Description

This is the first endpoint to call, it generates the company and also the public and private key for the user, it is inserted in default identity and it will be used to send transaction to blockchain network. The default identity is an Ethereum Public and Private Key, this identity can be used on several network for example xDai, Ethereum Mainnet, Quorum, Artis and others Ethereum Codebase Blockchain.

{% hint style="info" %}
The ***private key*** is encrypted with the API KEY and the API KEY is not saved in our database, there is only the md5 hash on database.
{% endhint %}

### Request

#### ENDPOINT

```http
POST "/identity"
```

#### BODY REQUEST <a href="#d631f37b-e6c4-4632-88b6-9f9420e16390" id="d631f37b-e6c4-4632-88b6-9f9420e16390"></a>

```javascript
{
	"company":{
		"name": "ACME S.p.A.",
		"domain": "acme.it"
	}
}
```

## 🖼️ Create an Asset <a href="#id-74c23a82-5a96-41a4-9c05-52fd739ada44" id="id-74c23a82-5a96-41a4-9c05-52fd739ada44"></a>

### Description

An asset is the template for a series of proofs, for example if you want to certify Internet of Things data you can create an asset and use it to certify sensors data, several assets can be useful to create separate streams of proofs.

{% hint style="danger" %}
In the future we will develop several application on several Blockchain but at the moment it's only available:

* Type: ***JSON***
* Application: ***timestamp*** useful to certify JSON data
* Blockchain: ***xDai*** Proof of Stake public blockchain
  {% endhint %}

### Request

#### ENDPOINT <a href="#id-879d2c59-6b7d-430d-a535-f5f90115962c" id="id-879d2c59-6b7d-430d-a535-f5f90115962c"></a>

```
POST "/assets"
```

#### BODY <a href="#f79b08cb-cbc9-44b8-8e7f-7a4ab473802b" id="f79b08cb-cbc9-44b8-8e7f-7a4ab473802b"></a>

```javascript
{
	"type": "JSON",
	"name": "Asset Name",
	"application": "timestamp",
	"description": "Assets Description",
	"backgroundImage": "url_image",
	"blockchain": "xDai"
}
```

## 🧾 Create a Proof <a href="#id-35a55955-4d4e-4926-a907-8d442dfc9525" id="id-35a55955-4d4e-4926-a907-8d442dfc9525"></a>

### Description

A proof is a core api, before create a proof you need to create an identity and asset because the proof will be signed with identity and receive from asset the structure for certification.

### Request

#### ENDPOINT <a href="#id-95fc742e-5597-4ac8-af87-2615b39f459d" id="id-95fc742e-5597-4ac8-af87-2615b39f459d"></a>

```
POST "/proofs"
```

#### BODY <a href="#dbd9fa12-17b5-4b33-a8f4-94f982ecdf12" id="dbd9fa12-17b5-4b33-a8f4-94f982ecdf12"></a>

```javascript
{
    "assetId": "fe602d7f-b807-4d65-bc29-23b4cea58bb7",
    "data": {
        "timestamp": "those",
        "data": "4ever"
    }
}
```

## 🔍 Verify with Trusty Proofs <a href="#dfdb509c-0193-49ac-b497-3a15b564e549" id="dfdb509c-0193-49ac-b497-3a15b564e549"></a>

This is an auto-generated page that can be used to demonstrate Proofs and Data. The following page is auto-generated for application ***timestamp.***

{% embed url="<https://uproofs.apio.cc/proofs/timestamp/01d1b684-f819-4558-a877-dd7e7dcf080d>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uproofs.apio.cc/tutorials/from-0-to-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
