# API Reference

### Overview

[JSON](http://json.org) is a lightweight data-interchange format. It can represent numbers, strings, ordered sequences of values, and collections of name/value pairs.

[JSON-RPC](http://www.jsonrpc.org/specification) is a stateless, light-weight remote procedure call (RPC) protocol. Primarily this specification defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON ([RFC 4627](http://www.ietf.org/rfc/rfc4627.txt)) as data format.

Djib API is mainly implemented as [JSON RPC 2.0](https://www.jsonrpc.org/specification) with two exceptions:

1. The health check endpoint that provides a health-check mechanism for load balancers or other network infrastructure use.
2. Regular HTTP post to ensure large file support and multiple files supporting the upload and download endpoint.

{% file src="<https://3144134972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6MrZ6BqPMP2mmJKSKsG8%2Fuploads%2FZNuIHL58CV3oyFlAQv5U%2FDjib%20JSON%20RPC%20API%20%20V3%20Staging.postman_collection.json?alt=media&token=b4ad9900-5cb7-4521-8b9c-06cb69c6fdc5>" %}
Postman Collection Template
{% endfile %}

### Endpoints

<table><thead><tr><th width="150">Network</th><th>Public Net</th><th>API</th></tr></thead><tbody><tr><td>Mainnet</td><td>https://public.djib.io</td><td>https://mainrpc.djib.io</td></tr><tr><td>Testnet</td><td>https://public.djib.io</td><td>https://testrpc.djib.io</td></tr><tr><td>Devnet</td><td>https://public.djib.io</td><td>https://devrpc.djib.io</td></tr></tbody></table>

### Error Codes

**JSON-RPC standard error code**

Standard error codes and their corresponding meanings are as follows:

| Code   | Message          | Definition                                                                                            |
| ------ | ---------------- | ----------------------------------------------------------------------------------------------------- |
| -32600 | Invalid Request  | The JSON sent is not a valid Request object.                                                          |
| -32601 | Method Not Found | The method does not exist / is not available.                                                         |
| -32602 | Invalid Params   | Invalid method parameter(s).                                                                          |
| -32603 | Internal Error   | Internal JSON-RPC error.                                                                              |
| -32700 | Parse Error      | Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. |

#### Djib RPC Error Code

| Code   | Message                       | Definition                                                                                       |
| ------ | ----------------------------- | ------------------------------------------------------------------------------------------------ |
| -32001 | Invalid Form Params           | Invalid form params on non-rpc method                                                            |
| -32002 | Invalid Public Key            | Invalid Public Key                                                                               |
| -32003 | Invalid Size Unit             | Supported units are: KB for kilobytes, MB for megabytes, GB for gigabytes, and TB for terabytes. |
| -32004 | Authorization Error           | Identity is not correct.                                                                         |
| -32005 | Invalid Size Number           | Size must be a float number, greater than zero.                                                  |
| -32006 | Record Not Found              | Requested record does not exist.                                                                 |
| -32007 | Duplicated Record             | Requested record is duplicated.                                                                  |
| -32008 | Cloud Storage Not Found       | User has no cloud storage.                                                                       |
| -32009 | No Enough Storage             | User has no enough cloud storage.                                                                |
| -32010 | Parent Not Found              | Requested parent does not exist.                                                                 |
| -32011 | File Not Found                | Requested file does not exist.                                                                   |
| -32012 | Incorrect Email Address       | Submitted email is incorrect.                                                                    |
| -32013 | Duplicated Email Address      | Submitted email is duplicated.                                                                   |
| -32014 | Large Avatar File             | Avatar file is large. Maximum acceptable size is 1 MB.                                           |
| -32015 | Not Confirmed Profile         | User profile confirmation is not completed.                                                      |
| -32016 | File Invalid Access           | User has no access to target file or password is incorrect.                                      |
| -32017 | File Shared Previously        | Cannot share file, because file shared before.                                                   |
| -32018 | Invalid NFT MetaData          | Invalid Metadata for NFT.                                                                        |
| -32019 | Unexpected Error NFT Creation | Unexpected Error on creation NFT.                                                                |
| -32020 | NFT Payment Not Finalized     | Payment is not finalized to create NFT.                                                          |
| -32021 | Shared Not Found              | No shared object exist with given access token.                                                  |
| -32022 | Invalid Share Credentials     | Given credentials are invalid to access object.                                                  |
| -32023 | No Sharing Credentials        | Given access link required credentials.                                                          |
| -32024 | Insufficient Funds            | You should top up your credits.                                                                  |
| -32025 | Insufficient SOL              | Insufficient SOL for network fee payer.                                                          |
| -32026 | Insufficient DJIB             | Insufficient DJIB for paying.                                                                    |
| -32027 | Solana Error                  | Solana is busy now! Please try later! You can check Solana status on <https://status.solana.com> |
| -32028 | Transaction Failed            | Transaction failed on Solana. Signature:                                                         |
| -32029 | NFT Not Found                 | NFT not found.                                                                                   |
| -32030 | Invalid Avatar Format         | Avatar format is a html base64 encoded image: 'data:\<ImageContentType>;base64,\<Data>'          |

### Non-RPC API

## Health Check

<mark style="color:blue;">`GET`</mark> `https://{api_url}/health`

Provides a health-check mechanism for load balancers or other network infrastructure use. It always returns HTTP 200 OK response with a body of "ok", "degraded", or "unknown".

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "status": "ok"
}
```

{% endtab %}

{% tab title="200: OK " %}

```javascript
{
    "status": "degraded"
}
```

{% endtab %}

{% tab title="200: OK " %}

```javascript
{
    "status": "unknown"
}
```

{% endtab %}
{% endtabs %}

## Upload file(s)

<mark style="color:green;">`POST`</mark> `https://{api_url}/upload`

This method enables users to upload their files on the IPFS network and their drive.

#### Path Parameters

| Name                                        | Type   | Description                                                                                                                                      |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| files\[]<mark style="color:red;">\*</mark>  | file   | list of files to be uploaded on Djib network                                                                                                     |
| type<mark style="color:red;">\*</mark>      | String | <p><code>public</code></p><p>for public upload of files on Djib IPFS network,</p><p><code>private</code></p><p>for uploading to user's drive</p> |
| publicKey<mark style="color:red;">\*</mark> | String | the public address of the wallet owner of files                                                                                                  |
| token                                       | String | the access token that you have received from auth method; this method is required for the private mode                                           |
| path                                        | String | destination folder of file on your drive required only for private mode                                                                          |

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

{% tabs %}
{% tab title="200: OK Success upload using public mode" %}

```javascript
{
    "result": [
        "{network_url}/<file hash>"
        ...
    ]
}
```

{% endtab %}

{% tab title="200: OK Success upload using private mode" %}

```javascript
{
    "result": [
        "<filepath>"
        ...
    ]
}
```

{% endtab %}
{% endtabs %}

## Download file

<mark style="color:blue;">`GET`</mark> `https://{api_url}/download`

This method enables users to download their file on their drive.

#### Path Parameters

| Name                                    | Type   | Description                                              |
| --------------------------------------- | ------ | -------------------------------------------------------- |
| token<mark style="color:red;">\*</mark> | String | the access token that you have received from auth method |
| path<mark style="color:red;">\*</mark>  | String | requested file destination on user drive                 |

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

{% tabs %}
{% tab title="200: OK file downloaded" %}
raw binary file
{% endtab %}
{% endtabs %}

## Download shared file

<mark style="color:blue;">`GET`</mark> `https://{api_url}/download-shared`

This method enables users to download their shared file on their drive.

#### Path Parameters

| Name  | Type   | Description                                              |
| ----- | ------ | -------------------------------------------------------- |
| token | String | the access token that you have received from auth method |
| path  | String | requested file destination on user drive                 |

#### Headers

| Name         | Type   | Description         |
| ------------ | ------ | ------------------- |
| Content-Type | String | multipart/form-data |

## Confirm email

<mark style="color:blue;">`GET`</mark> `https://{api_url}/email-confirm/:token`

This method confirm user email

#### Path Parameters

| Name                                    | Type   | Description |
| --------------------------------------- | ------ | ----------- |
| token<mark style="color:red;">\*</mark> | String | Token       |

### RPC Methods

* [handshake](#handshake)
* [auth](#auth)
* [estimate](#auth-1)
* [createPayment](#createpayment)
* [confirmPayment](#getpaymentaddress)
* [buyStorage](#createdrive)
* [status](#status)
* [lsDrive](#statusdrive-1)
* [createFolder](#createfolder)
* [lsDrive](#lsdrive)
* [destroyDrive](#destroydrive)
* [shareFromDrive](#sharefromdrive)
* [search](#search)
* [recentFiles](#recentfiles)
* [moveTrash](#movetrash)
* [lsTrash](#lsdrive-1)
* [restoreFromTrash](#lsdrive-2)
* [setFavorite](#lsdrive-3)
* [lsFavorite](#lsdrive-4)
* [unsetFavorite](#unsetfavorite)
* [rename](#rename)
* [move](#move)
* [copy](#copy)
* [duplicate](#duplicate)
* [lsPublic](#lspublic)
* [savePublic](#lspublic-1)
* [lsFileShares](#lsfileshares)
* [lsShareWithMe](#copy-1)
* [lsShareByMe](#copy-2)
* [shareObject](#copy-3)
* [revokeShares](#copy-4)
* [getSharedByLink](#copy-5)
* [rmSharedWithMe](#copy-6)
* [deleteTrash](#copy-7)
* [emptyTrash](#copy-8)
* [getProfile](#copy-9)
* [setProfile](#copy-10)
* [resendVerificationEmail](#copy-11)
* [createTopUpPayment](#copy-12)
* [confirmTopUpPayment](#copy-13)
* [lsPayments](#lspayments)
* [lsDailyBalance](#lsdailybalance)
* [createNftPayment](#createnftpayment)
* [saveAsNft](#saveasnft)
* [uploadAsset](#uploadasset)
* [lsNfts](#lsnfts)
* [lsNftFamilies](#lsnftfamilies)

### handshake

Creates a message for signing private drive session authorization

**Parameters**

* `<string>`- A PublickKey of account as base-58 encoded string

**Results**

* `<string>` - An string message for signing on client wallet

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "handshake",
    "params": [
        "<PublicKey>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "Sign this message for authenticating with your wallet. Nonce: <NonceCode>",
    "id": 0
}
```

### auth

Returns an access token for authorizing a private drive session

**Parameters**

* `<string>`- A PublicKey of account as base-58 encoded string
* `<string>`- A signed message signature as base-58 encoded string

**Results**

* `<string>` - An access token as base-58 encoded string

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "auth",
    "params": [
            "<PublicKey>",
            "<Token>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "<Token>",
    "id": 0
}
```

### estimate

Estimates file storage price based on Djib Token for use on private drive storage or public drive uploading

**Parameters**

* `<string>` - Token
* `<number>`- Requested size
* `<string>`- Unit of size \["`KB`", "`MB`", "`GB`", "`TB`"]

**Results**

* `<float>` - Estimated price based on Djib Token

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "estimate",
    "params": [
            "<Token>",
            99614720,
            "KB"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": 94.633984,
    "id": 0
}
```

### createPayment

Creates [Solana Pay](https://docs.solanapay.com/) standard URL for paying Djib Token used on buying storage.

**Parameters**

* `<string>` - An access token as base-58 encoded string
* `<number>`- Requested size
* `<string>`- Unit of size \["`KB`", "`GB`", "`TB`"]

**Results**

* `<object>`- A JSON object containing:
  * `payment_url: <number>`- Solana Pay standard URL
  * `tracking_code: <string>`- A code to track transaction status&#x20;

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "createPayment",
    "params": [
            "<Token>"
            1048576,
            "KB"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "payment_url": "solana:<PublicKey:str>?amount=<Number:unsigned float>&spl-token=<PublicKey:str>&memo=djib&message=Thanks%21&label=DjibChain&reference=<TrackingCode:str>",
        "tracking_code": "<TrackingCode:str>"
    },
    "id": 0
}
```

### confirmPayment <a href="#confirmpayment" id="confirmpayment"></a>

Confirms the storage payment and returns the final status of payment.

**Parameters**

* `<string>` - An access token as base-58 encoded string
* `<string>` - A code to track transaction status

**Results**

* `<object>`- A JSON object containing:
  * `finalized: <string>` - Status of finalization
  * `signature: <string>` - Signature of transaction

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "confirmPayment",
    "params": [
       "<Token:str>",
       "<TrackingCode:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "finalized": true,
        "signature": "<Signature:str>"
    },
    "id": 0
}
```

### buyStorage

Buy drive storage on Djib private network. You can use a payment tracking code or credit balance.

**Parameters**

* `<string>` - An access token as base-58 encoded string
* `<object>` -  A JSON object containing:
  * `tracking_code: <string>` - TrackingCode of payment
  * `size: <string>` -  Requested size
  * `unit: <string>` - Unit of size \["`KB`", "`MB`", "`GB`", "`TB`"]
  * `ref_code: <string>` - PublicKey of invitation

**Results**

* `<object>`- A JSON object containing:
  * `<string>` - A status message \["`success`" or "`failed`"]

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "buyStorage",
    "params": [
       "<Token:str>",
        {
           "tracking_code": "<TrackingCode:str>",
           "size": 1,
           "unit": "<Text:str[KB,MB,GB,TB]>",
           "ref_code": "<Token:str>"
       }
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### status <a href="#status" id="status"></a>

Returns status of drive.

**Parameters**

* `<string>` - An access token as base-58 encoded string

**Results**

* `<object>`- A JSON object containing:
  * `cloud: <object>`- A JSON object containing
    * `used_size_kb: <float>`- Used size of drive storage in KB
    * `total_size_kb: <float>`- Total size of drive storage in KB
    * `created_at: <date>`- Date of drive creation
    * `updated_at: <date>`- Date of last modification on drive
  * `prizes: <array>`- Set of prizes&#x20;
  * `credit: <float>`- Credit balance

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "status",
    "params": [
       "<Token>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "cloud": {
            "used_size_kb": 0,
            "total_size_kb": 0,
            "created_at": "None",
            "updated_at": "None"
        },
        "prizes": [],
        "credit": 0.0
    },
    "id": 0
}
```

### claimPrize

Claims prizes for participatory activities

**Parameters**

* `<string>` - An access token as base-58 encoded string

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "claimPrize",
    "params": [
       "<Token>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### createFolder <a href="#createfolder" id="createfolder"></a>

Creates new folder on drive.

**Parameters**

* `<string>` - An access token as base-58 encoded string
* `<string>` - Path to folder
* `<string>` - Folder name

**Results**

* `<string>`- Created folder path

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "createFolder",
    "params": [
        "<Token:str>",
        "/",
        "<Text:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "<Text of path>",
    "id": 0
}
```

### **lsDrive** <a href="#lsdrive" id="lsdrive"></a>

Returns list of stored objects on drive.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- A Path of stored objects on drive

**Results**

* `<array>`- An array of JSON objects containing:
  * `file_name: <string>`- Path of stored object on drive
  * `extension: <string>`- Extension of stored object on drive
  * `size_byte: <float>`- Size of stored object on drive in bytes
  * `is_folder: <bool>`- Is stored object is folder or not
  * `is_favourite: <bool>`- Is stored object selected as favourite or not
  * `path: <string>`- A path to listed object
  * `parent: <string>`- A path to parent of listed object
  * `content_type: <string>`- The content\_type header of selcted file
  * `public_link: <string>`- Link of file on IPFS public network if file has been shared publicly
  * `created_at: <date>`- Date of object creation
  * `updated_at: <date>`- Date of last modification on object

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "lsDrive",
    "params": [
        "<Token:str>",
        "/"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "file_name": "djib",
            "extension": "svg",
            "size_byte": 1,
            "is_folder": false,
            "is_favorite": false,
            "path": "/djib.svg",
            "parent": "/",
            "content_type": "image/svg+xml",
            "public_link": null,
            "created_at": "2022-05-19 09:58:48.836000",
            "updated_at": "2022-05-19 09:58:48.836000"
        }
    ],
    "id": 0
}
```

### destroyDrive

Destroys user drive and all contents except publicly shared files.

**Parameters**

* `<string>`- An access token as base-58 encoded string

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "destroyDrive",
    "params": [
        "<Token:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "result": "Coming Soon!",
    "id": 0,
    "jsonrpc": "2.0"
}
```

### shareFromDrive

Shares private objects on Djib public network.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- A path to file&#x20;

**Results**

* `<string>`- shared objects public URL

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "shareFromDrive",
    "params": [
        "<Token:str>",
        "/Object Path"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "https://devnet.djib.io/<Cid:str>",
    "id": 0
}
```

### search

Searches objects on drive.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Keyword&#x20;
* `<object>`- A JSON object containing:
  * `extension: <string>`- Extension of target object
  * `path: <string>`- Path to target object
* `<string>`- Name of object

**Results**

* `<array>`- An array of JSON objects containing:
  * `file_name: <string>`- Path of stored object on drive
  * `extension: <string>`- Extension of stored object on drive
  * `size_byte: <float>`- Size of stored object on drive in bytes
  * `is_folder: <bool>`- Is stored object is folder or not
  * `path: <string>`- A path to listed object
  * `parent: <string>`- A path to parent of listed object
  * `public_link: <string>`- Link of file on IPFS public network if file has been shared publicly
  * `created_at: <date>`- Date of object creation
  * `updated_at: <date>`- Date of last modification on object

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "search",
    "params": [
        "<Token:str>",
        "<Text:str>",
        {
            "extension": "png",
            "path": "/"
        }
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "file_name": "djib",
            "extension": "svg",
            "size_byte": 1,
            "is_folder": false,
            "is_favorite": false,
            "path": "/djib.svg",
            "parent": "/",
            "content_type": "image/svg+xml",
            "public_link": null,
            "created_at": "2022-05-19 09:58:48.836000",
            "updated_at": "2022-05-19 09:58:48.836000"
        }
    ],
    "id": 0
}
```

### recentFiles

Returns list of recently interacted files on private drive.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<int>`- Number of recent files&#x20;

**Results**

* `<array>`- An array of JSON objects containing:
  * `file_name: <string>`- Path of stored object on drive
  * `extension: <string>`- Extension of stored object on drive
  * `size_byte: <float>`- Size of stored object on drive in bytes
  * `is_folder: <bool>`- Is stored object is folder or not
  * `path: <string>`- A path to listed object
  * `parent: <string>`- A path to parent of listed object
  * `public_link: <string>`- Link of file on IPFS public network if file has been shared publicly
  * `created_at: <date>`- Date of object creation
  * `updated_at: <date>`- Date of last modification on object

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "recentFiles",
    "params": [
        "<Token:str>",
        10
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "file_name": "djib",
            "extension": "svg",
            "size_byte": 1,
            "is_folder": false,
            "is_favorite": false,
            "path": "/djib.svg",
            "parent": "/",
            "content_type": "image/svg+xml",
            "public_link": null,
            "created_at": "2022-05-19 09:58:48.836000",
            "updated_at": "2022-05-19 09:58:48.836000"
        }
    ],
    "id": 0
}
```

### moveTrash

Moves objects into trash.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<array>`- An array containing objects paths&#x20;

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "moveTrash",
    "params": [
        "<Token:str>",
        [
            "/Object Path"
        ]
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### **lsTrash** <a href="#lsdrive" id="lsdrive"></a>

Returns list of moved objects on trash.

**Parameters**

* `<string>`- An access token as base-58 encoded string

**Results**

* `<array>`- An array of JSON objects containing:
  * `file_name: <string>`- Path of stored object on drive
  * `extension: <string>`- Extension of stored object on drive
  * `size_byte: <float>`- Size of stored object on drive in bytes
  * `is_folder: <bool>`- Is stored object is folder or not
  * `is_favourite: <bool>`- Is stored object selected as favourite or not
  * `path: <string>`- A path to listed object
  * `parent: <string>`- A path to parent of listed object
  * `content_type: <string>`- The content\_type header of selcted file
  * `public_link: <string>`- Link of file on IPFS public network if file has been shared publicly
  * `created_at: <date>`- Date of object creation
  * `updated_at: <date>`- Date of last modification on object
  * `deleted_at: <date>`- Date of moving to trash

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "lsTrash",
    "params": [
        "<Token:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "file_name": "djib",
            "extension": "svg",
            "size_byte": 1,
            "is_folder": false,
            "is_favorite": false,
            "path": "/djib.svg",
            "parent": "/",
            "content_type": "image/svg+xml",
            "public_link": null,
            "created_at": "2022-05-19 09:58:48.836000",
            "updated_at": "2022-05-19 09:58:48.836000",
            "deleted_at": "2022-05-19 09:58:48.836000"
        }
    ],
    "id": 0
}
```

### **restoreFromTrash** <a href="#lsdrive" id="lsdrive"></a>

Restores object from trash.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Object path on trash
* `<string>`- Delete date of object

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "restoreFromTrash",
    "params": [
        "<Token:str>",
        "/Object Path",
        "<ISODateTime:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### **setFavorite** <a href="#lsdrive" id="lsdrive"></a>

Marks object as favorite.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Object path on drive

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "setFavorite",
    "params": [
        "<Token:str>",
        "/Object Path"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### **lsFavorite** <a href="#lsdrive" id="lsdrive"></a>

Returns list of marked objects as favorite on drive.

**Parameters**

* `<string>`- An access token as base-58 encoded string

**Results**

* `<array>`- An array of JSON objects containing:
  * `file_name: <string>`- Path of stored object on drive
  * `extension: <string>`- Extension of stored object on drive
  * `size_byte: <float>`- Size of stored object on drive in bytes
  * `is_folder: <bool>`- Is stored object is folder or not
  * `is_favourite: <bool>`- Is stored object selected as favourite or not
  * `path: <string>`- A path to listed object
  * `parent: <string>`- A path to parent of listed object
  * `content_type: <string>`- The content\_type header of selcted file
  * `public_link: <string>`- Link of file on IPFS public network if file has been shared publicly
  * `created_at: <date>`- Date of object creation
  * `updated_at: <date>`- Date of last modification on object

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "lsFavorite",
    "params": [
        "<Token:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "file_name": "djib",
            "extension": "svg",
            "size_byte": 1,
            "is_folder": false,
            "is_favorite": false,
            "path": "/djib.svg",
            "parent": "/",
            "content_type": "image/svg+xml",
            "public_link": null,
            "created_at": "2022-05-19 09:58:48.836000",
            "updated_at": "2022-05-19 09:58:48.836000"
        }
    ],
    "id": 0
}
```

### unsetFavorite

Unsets the object mark from favorite.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Path to object on private drive

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "unsetFavorite",
    "params": [
        "<Token:str>",
        "/Object Path"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### rename

Renames an object on private drive.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Path to object on private drive
* `<string>`- New name for specified object

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "rename",
    "params": [
        "<Token:str>",
        "/Object Path",
        "<Text:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### move

Moves an object to another directory.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Path to object on private drive
* `<string>`- New directory to move in

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "move",
    "params": [
        "<Token:str>",
        "/Old Path",
        "/New Path"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### copy

Copies an object to another directory.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Path to object on private drive
* `<string>`- New directory to copy in

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "copy",
    "params": [
        "<Token:str>",
        "/Object Path",
        "/Dest Path"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### duplicate

Duplicates an object .

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Path to object on private drive

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "duplicate",
    "params": [
        "<Token:str>",
        "/Object Path"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### lsPublic

Returns list of publicly shared files.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<bool>`- Flag to set only public files

**Results**

* `<array>`- An array of JSON objects containing:
  * `cid: <string>`- Cid of shared file
  * `link: <string>`- Link to object on public network
  * `file_name: <string>`- Name of file
  * `size_byte <float>`- Size of stored object on drive in bytes
  * `content_type: <string>`- The content\_type header of selcted file
  * `drive_path: <string>`- Path to object on private drive
  * `created_at: <date>`- Date of object creation

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "lsPublic",
    "params": [
        "<Token:str>",
        false
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "cid": "<Cid:str>",
            "link": "https://devnet.djib.io/<Cid:str>",
            "file_name": "djib.svg",
            "size_byte": 2431,
            "content_type": "image/svg+xml",
            "drive_path": "/djib.svg",
            "created_at": "2022-05-19 21:14:42.097000"
        }
    ],
    "id": 0
}
```

### savePublic

Saves list of public files on private drive.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<array>`- An array of publicly shared objects
* `<string>`- Path on private drive to save public files&#x20;

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "savePublic",
    "params": [
        "<Token:str>",
        [
            "<Cid:str>"
        ],
        "/Drive Path"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### lsFileShares

List all sharing records of a file.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Path to object on private drive

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "lsFileShares",
    "params": [
        "<Token:str>",
        "/djib"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "shares": [
            {
                "link": "<Link:str>",
                "has_pass": true,
                "is_public": false,
                "share_email": "john@doe.com",
                "created_at": "2022-06-05 02:33:53.837000"
            }
        ],
        "has_pass": false
    },
    "id": 0
}
```

### lsShareWithMe

List of all objects that shared with user.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<object>`- A JSON objects containing:
  * `path: <string>`- Path to object on private drive
  * `owner: <string>`- Email address of file owner
  * `password: <string>`- Password of file if the file locked

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "lsShareWithMe",
    "params": [
        "<Token:str>",
        {
            "path": "/Shared/Object Path",
            "owner": "john@doe.com",
            "password": "123456"
        }
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "file_name": "djib",
            "size_byte": 44665,
            "extension": "svg",
            "content_type": "image/xml+svg",
            "is_folder": false,
            "created_at": "2022-05-27 08:26:19.358000",
            "updated_at": "2022-05-27 08:26:19.358000",
            "path": "/Shared/djib.svg",
            "shared_at": "2022-05-27 08:51:01.569000"
        }
    ],
    "id": 0
}
```

### lsShareByMe

List of all objects that shared by user.

**Parameters**

* `<string>`- An access token as base-58 encoded string

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "lsShareByMe",
    "params": [
        "<Token:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "file_name": "djib",
            "extension": null,
            "size_byte": 0,
            "is_folder": true,
            "is_favorite": false,
            "path": "/djib",
            "parent": "/",
            "content_type": null,
            "public_link": null,
            "created_at": "2022-06-10 00:02:06.987000",
            "updated_at": "2022-06-10 00:02:06.987000"
        }
    ],
    "id": 0
}
```

### shareObject

Share an object.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Path to object on private drive
* `<object>`- A JSON objects containing:
  * `path: <string>`- Path to object on private drive
  * `owner: <string>`- Email address of file owner
  * `password: <string>`- Password of file if the file locked

**Results**

* `<string>`- Sharing code/link of object

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "shareObject",
    "params": [
        "<Token:str>",
        "/djib.svg",
        {
            "password": "a",
            "email": "john@doe.com"
        }
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "<Link:str>",
    "id": 0
}
```

### revokeShares

Delete sharing records of an object.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Path to object on private drive
* `<array>`- An array of sharing codes/links

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "revokeShares",
    "params": [
        "<Token:str>",
        "/File Path",
        [
            "<Link:str>"
        ]
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### getSharedByLink

Get shared record by link/code.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Path to object on private drive
* `<object>`- A JSON objects containing:
  * `path: <string>`- Path to object on private drive
  * `owner: <string>`- Email address of file owner
  * `password: <string>`- Password of file if the file locked

**Results**

* `<string>`- A sharing path for exploring by lsShareWithMe

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "getSharedByLink",
    "params": [
        "<Token:str>",
        "<Link:str>",
        {
            "password": "123456"
        }
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "/Shared/djib",
    "id": 0
}
```

### rmSharedWithMe

Remove sharing record.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Path to object on private drive
* `<string>`- Owner email address

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "rmSharedWithMe",
    "params": [
        "<Token:str>",
        "/djib",
        "john@doe.com"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### deleteTrash

Delete an object from trash permanently.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<string>`- Path to object on private drive
* `<string>`- Object deleted at date

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "deleteTrash",
    "params": [
        "<Token:str>",
        "/Object Path",
        "<DeletedAt:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### emptyTrash

Erase all trash objects permanently.

**Parameters**

* `<string>`- An access token as base-58 encoded string

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "moveTrash",
    "params": [
        "<Token:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### getProfile

Get user profile information.

**Parameters**

* `<string>`- An access token as base-58 encoded string

**Results**

* `<object>`- A JSON objects containing:
  * `email: <string>`- User email address
  * `name: <string>`- User full name
  * `avatar: <string>`- Base64 encoded avatar file
  * `ref_code: <string>`- User referral code
  * `confirmation: <string>`- User email confirmation token

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "getProfile",
    "params": [
        "<Token:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "email": "<EmailAddress:str>",
        "name": "<Text:str>",
        "avatar": "data:<ImageContentType:str>;base64,<Base64Encoded:str>",
        "confirmation": "<Token:str>",
        "ref_code": "<Token:str>",
        "invited_by": "<PublicKey:str>"
    },
    "id": 0
}
```

### setProfile

Set profile information.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<object>`- A JSON objects containing:
  * `email: <string>`- User email address
  * `name: <string>`- User full name
  * `avatar: <string>`- Base64 encoded avatar file

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "setProfile",
    "params": [
        "<Token:str>",
        {
            "email": "<EmailAddress:str>",
            "name": "<Text:str>",
            "avatar": "data:<ImageContentType:str>;base64,<Base64Encoded:str>"
        }
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### resendVerificationEmail

Resend verification email for confirming.

**Parameters**

* `<string>`- An access token as base-58 encoded string

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "resendVerificationEmail",
    "params": [
        "<Token:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "success",
    "id": 0
}
```

### createTopUpPayment

Creates [Solana Pay](https://docs.solanapay.com/) standard URL for increasing credits balance on Djib Token.

**Parameters**

* `<string>` - An access token as base-58 encoded string
* `<number>`- Requested size

**Results**

* `<object>`- A JSON object containing:
  * `payment_url: <number>`- Solana Pay standard URL
  * `tracking_code: <string>`- A code to track transaction status&#x20;

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "createTopUpPayment",
    "params": [
        "<Token:str>",
        "<Number:unsigned float>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "payment_url": "solana:<PublicKey:str>?amount=<Number:unsigned float>&spl-token=<PublicKey:str>&memo=djib&message=Thanks%21&label=DjibChain&reference=<TrackingCode:str>",
        "tracking_code": "<TrackingCode:str>"
    },
    "id": 0
}
```

### confirmTopUpPayment

Confirms the storage payment and returns the final status of payment.

**Parameters**

* `<string>` - An access token as base-58 encoded string
* `<string>` - A code to track transaction status

**Results**

* `<object>`- A JSON object containing:
  * `finalized: <string>` - Status of finalization
  * `signature: <string>` - Signature of transaction

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "confirmTopUpPayment",
    "params": [
       "<Token:str>",
       "<TrackingCode:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "finalized": true,
        "signature": "<Signature:str>"
    },
    "id": 0
}
```

### lsPayments

Returns list of payment records

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<number>`- Margin
* `<number>`- Count

**Results**

* `<object>`- A JSON object containing:
  * `payments: <array>` - A JSON object containing:
    * `method: <string>` - Payment method \['`PAYMENT`', '`TOPUP`']
    * `price: <float>` - Payed price
    * `amount: <float>` - Requested size
    * `unit: <string>` - Unit of request \['`KB`', '`MB`', '`GB`', '`TB`', '`NFT`']
    * `status: <string>` - Status of payment \['`pending`', '`success`', '`failed`']
    * `signature: <string>` - Signature of the transaction
    * `message: <string>` - Message of status
    * `payed_at: <string>` - ISO date time
    * `created_at: <string>` - ISO date time
    * `updated_at: <string>` - ISO date time
  * `options: <object>` - A JSON object containing:
    * `total: <number>` - Total number of all records
    * `count: <number>` - Count
    * `margin: <number>` - Margin

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "lsPayments",
    "params": [
       "<Token:str>",
        0,
        10
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "payments": [
            {
                "method": "PAYMENT",
                "price": 1.0,
                "amount": 1,
                "unit": "GB",
                "status": "sold",
                "signature": "<Signature:str>",
                "message": "<Text:str>",
                "payed_at": "<ISODateTime:str>",
                "created_at": "<ISODateTime:str>",
                "updated_at": "<ISODateTime:str>"
            }
        ],
        "options": {
            "total": 1,
            "count": 10
        }
    },
    "id": 0
}
```

### lsDailyBalance

Returns balance changes.

**Parameters**

* `<string>`- An access token as base-58 encoded string
* `<number>`- Days ago

**Results**

* `<object>`- A JSON object containing:
  * `time: <string>` - YYYY-MM-DD
  * `balance: <float>` - Balance

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "lsDailyBalance",
    "params": [
       "<Token:str>",
        7
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "time": "2022-06-23",
            "balance": 0
        },
        {
            "time": "2022-06-24",
            "balance": 0
        },
        {
            "time": "2022-06-25",
            "balance": 0
        },
        {
            "time": "2022-06-26",
            "balance": 0
        },
        {
            "time": "2022-06-27",
            "balance": 0
        },
        {
            "time": "2022-06-28",
            "balance": 0
        },
        {
            "time": "2022-06-29",
            "balance": 0
        },
        {
            "time": "2022-06-30",
            "balance": 0
        }
    ],
    "id": 0
}
```

### createNftPayment

Creates [Solana Pay](https://docs.solanapay.com/) standard URL for paying Djib Token used saving a file as an NFT

**Parameters**

* `<string>` - An access token as base-58 encoded string
* `<number>`- Count of requested NFT

**Results**

* `<string>`- A success message

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "createNftPayment",
    "params": [
        "<Token:str>",
        "<Number:unsigned float>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "payment_url": "solana:<PublicKey:str>?amount=<Number:unsigned float>&spl-token=<PublicKey:str>&memo=djib&message=Thanks%21&label=DjibChain&reference=<TrackingCode:str>",
        "tracking_code": "<TrackingCode:str>"
    },
    "id": 0
}
```

### saveAsNft

Saves a file as an NFT.

**Parameters**

* `<string>` - An access token as base-58 encoded string
* `<string>` - Path of the object
* `<object>` - A JSON object containing:
  * `thumbnail: <string>`- An IPFS cid of the thumbnail
  * `name: <string>`- Name of NFT
  * `symbol: <string>`- Symbol of NFT
  * `description: <string>`- Description of NFT
  * `seller_fee_basis_points: <number>`- Seller fee in percentage
  * `external_url: <string>`- An external URL
  * `attributes: <array>`- Array of JSON object containing:
    * `trait_type: <string>`- Attribute name
    * `value: <string>`- Value of attribute
  * `collection: <string>`- Collection name
  * `family: <string>`- Family name

**Results**

* `<object>`- A JSON object containing:
  * `cid: <string>`- An IPFS cid of the thumbnail
  * `created_at: <string>`- ISO date time of NFT creation time

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "saveAsNft",
    "params": [
        "<Token:str>",
        "/djib.svg",
        {
            "thumbnail": null,
            "name": "test",
            "symbol": "TEST",
            "description": "Desc for test",
            "seller_fee_basis_points": 0,
            "external_url": "https://app.djib.io",
            "attributes" : [ { "trait_type" : "Power" , "value" : "Rare" } ],
            "collection": "Test1",
            "family": "Test11"
        }
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "cid": "<Token:str>",
        "created_at": "<ISODateTime:str>"
    },
    "id": 0
}
```

### uploadAsset

Uploads NFT asset after saving NFT

**Parameters**

* `<string>` - An access token as base-58 encoded string
* `<string>` - An IPFS cid of NFT file
* `<string>` - ISO date time of NFT creation time
* `<string>` - Tracking code of payment (Optional)

**Results**

* `<string>`- An IPFS cid of NFT file

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "uploadAsset",
    "params": [
        "<Token:str>",
        "<Cid:str>",
        "<ISODateTime:str>",
        "<TrackingCode:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": "<Cid:str>",
    "id": 0
}
```

### lsNfts

Returns list of all NFTs

**Parameters**

* `<string>` - An access token as base-58 encoded string
* `<object>`- A JSON object containing:
  * `family: <string>`- Name of special family
  * `count: <number>`- Count
  * `margin: <string>`- Margin

**Results**

* `<object>`- A JSON object containing:
  * `nfts: <object>`- A JSON object containing
    * `token: <string>`- Token address of NFT
    * `signature: <string>`- Signature of NFT creation
    * `metadata: <object>`- The NFT metadata saved on blockchain
    * `message: <string>`- Message of NFT creation process
    * `created_at: <date>`- Date of drive creation
    * `updated_at: <date>`- Date of last modification on drive
  * `options: <object>` - A JSON object containing:
    * `family: <string>` - Family name of filter
    * `total: <number>` - Total number of all records
    * `count: <number>` - Count
    * `margin: <number>` - Margin

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "lsNfts",
    "params": [
        "<Token:str>",
        {
            "family": "Test1",
            "count": 10,
            "skip": 0
        }
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "nfts": [
            {
                "token": "<NFTPublicKey:str>",
                "signature": "<Signature:str>",
                "metadata": {
                    "name": "test",
                    "symbol": "TEST",
                    "description": "Desc for test",
                    "image": "https://public.djib.io/<Cid:str>",
                    "external_url": "https://app.djib.io",
                    "properties": {
                        "creators": [
                            {
                                "address": "<PublicKey:str>",
                                "share": 100
                            },
                            {
                                "address": "DjibYsyKG5sD32Zp1rZHzJyM91ppkAmQ4irDdenUouP7",
                                "share": 0
                            }
                        ],
                        "files": [
                            {
                                "uri": "https://public.djib.io/<Cid:str>",
                                "type": "application/octet-stream"
                            },
                            {
                                "uri": "https://public.djib.io/<Cid:str>",
                                "type": "image/base64"
                            }
                        ]
                    },
                    "collection": {
                        "name": "Test11",
                        "family": "Test1"
                    },
                    "seller_fee_basis_points": 0,
                    "attributes": [
                        {
                            "trait_type": "Power",
                            "value": "Rare"
                        }
                    ]
                },
                "status": "success",
                "message": "Success!",
                "created_at": "2022-06-05 07:34:09.702000",
                "updated_at": "2022-06-05 07:34:09.702000"
            }
        ],
        "options": {
            "family": "Test1",
            "total": 1,
            "skip": 0,
            "count": 10
        }
    },
    "id": 0
}
```

### lsNftFamilies

Returns status of drive.

**Parameters**

* `<string>` - An access token as base-58 encoded string

**Results**

* `<array>`- c
  * `family: <string>`- Family name
  * `collections: <array>`- An array of string

**Example**

Request:

```shell
curl {api_url} -X POST -H "Content-Type: application/json" -d '
{
    "method": "lsNftFamilies",
    "params": [
        "<Token:str>"
    ],
    "jsonrpc": "2.0",
    "id": 0
}
'
```

Result:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "collections": [
                "collection name",
                "collection name1"
            ],
            "family": "family name"
        }
    ],
    "id": 0
}
```
