

アカウントには所有しているデバイスなどに応じてリポジトリというクラウド上の容量が与えられ  
任意のファイルをupload/downloadが可能です。

また、REST APIでのupload/downloadが可能になっています。

## アップロード

リポジトリにファイルをアップロードします。存在する場合は上書きします。

```
POST /users/me/repo/{file_name}
```

### Request Parameter

<table class="table-default">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>access\_token</td>
<td>Cookie</td>
<td>Required</td>
<td>String of user's access token</td>
</tr>
<tr>
<td>file</td>
<td>Body/Multipart-form</td>
<td>Required</td>
<td>The file to be uploaded</td>
</tr>
</tbody>
</table>

### Response

json format.

<table class="table-default">
<thead>
<tr>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>Success</td>
</tr>
<tr>
<td>400</td>
<td>Format Error</td>
</tr>
<tr>
<td>403</td>
<td>Invalid access token / capacity full</td>
</tr>

</tbody>
</table>


## ダウンロード

リポジトリからファイルをダウンロードします

```
GET /users/me/repo/{file_name}
```

or

```
GET /users/{user_id}/repo/{file_name}
```

### Request Parameter

<table class="table-default">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>access\_token</td>
<td>Cookie</td>
<td>Optional</td>
<td>String of user's access token</td>
</tr>
</tbody>
</table>


### Response

File it self. octet-stream.

<table class="table-default">
<thead>
<tr>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>Success</td>
</tr>
<tr>
<td>403</td>
<td>Invalid access token / capacity full</td>
</tr>
<tr>
<td>404</td>
<td>Not Found</td>
</tr>

</tbody>
</table>
