API Upload files to Rdiafile
Published: 2023-06-12 19:11:25

`<section id="article" class="article-container ng-star-inserted"><h1 class="article-title"><span>API Upload files to Rdiafile</span><!----></h1><div class="article-body"><div class="account_pages py-4">
<div class="container">
<h2 id="overview" class="page-content__title h1">Overview</h2>
<p class="lead">The file upload API is an interface which can be used in your own applications to securely upload, manage and download files externally from this website. This API will evolve over time when access to other data within the system is made available. However, none of the current endpoints or response values will change. <a href="https://developers.rediafile.com/help-center/articles/6/file-and-folders-api-create,read,-update#responses" target="_blank" rel="noopener">You can write your integration</a> code knowing that it will now be affected by future updates.</p>
<div class="row block-large-1-2 block-tab-full"><!-- end page --></div>
<!-- end main -->
<div class="s-content">
<div class="row">
<div id="main" class="s-content__main large-8 column">
<section class="page-content">
<section class="page-content">
<div class="opblock-description-wrapper">
<div class="table-container">
<table>
<tbody>
<tr class="parameters" data-property-name="file">
<td class="parameters-col_name">
<div class="parameter__name">file</div>
<div class="parameter__type">string<span class="prop-format">($binary)</span></div>
<div class="parameter__deprecated">&nbsp;</div>
</td>
<td class="parameters-col_description">
<div class="renderedMarkdown">
<p>Content of file to<a href="https://developers.rediafile.com/help-center/articles/3/authenticate-api-requests-to-rediafile" target="_blank" rel="noopener"> upload to Rdiafile</a></p>
</div>
</td>
</tr>
<tr class="parameters" data-property-name="parentId">
<td class="parameters-col_name">
<div class="parameter__name">parentId</div>
<div class="parameter__type">integer</div>
<div class="parameter__deprecated">&nbsp;</div>
</td>
<td class="parameters-col_description">
<div class="renderedMarkdown">
<p>ID of folder where this file should be uploaded, <code>null</code> will upload to root</p>
</div>
</td>
</tr>
<tr class="parameters" data-property-name="relativePath">
<td class="parameters-col_name">
<div class="parameter__name">relativePath</div>
<div class="parameter__type">string</div>
<div class="parameter__deprecated">&nbsp;</div>
</td>
<td class="parameters-col_description">
<div class="renderedMarkdown">
<p>Folders in the path provided here will be auto created, if they don't exist already. This is mainly useful when uploading a folder from browser. It should include original filename as well: <br><code>/some/folders/here/file-name.jpg</code></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</section>
<div class="responses-wrapper">
<div class="opblock-section-header">
<h2 id="responses">Responses</h2>
</div>
<div class="responses-inner">
<table id="post_uploads_responses" class="responses-table" role="region" aria-live="polite">
<thead>
<tr class="responses-header">
<td class="col_header response-col_status">Code</td>
<td class="col_header response-col_description">Description</td>
<td class="col col_header response-col_links">Links</td>
</tr>
</thead>
<tbody>
<tr class="response " data-code="201">
<td class="response-col_status">201</td>
<td class="response-col_description">
<div class="response-col_description__inner">
<div class="renderedMarkdown">
<p><a href="https://app.rediafile.com" target="_blank" rel="noopener">File was uploaded</a></p>
</div>
</div>
<section class="response-controls">
<div class="response-control-media-type response-control-media-type--accept-controller"><small class="response-control-media-type__title">Media type</small>
<div class="content-type-wrapper "><select class="content-type" aria-label="Media Type">
<option value="application/json">application/json</option>
</select></div>
<small class="response-control-media-type__accept-message">Controls <code>Accept</code> header.</small></div>
</section>
<div class="model-example">
<ul class="tab" role="tablist">
<li class="tabitem active" role="presentation"><button id="A1G89bs=" class="tablinks" role="tab" aria-controls="N3oHbZM=" aria-selected="true" data-name="example">Example Value</button></li>
<li class="tabitem" role="presentation"><button id="4Nc9kUM=" class="tablinks" role="tab" aria-controls="zXyDYJY=" aria-selected="false" data-name="model">Schema</button></li>
</ul>
<div id="N3oHbZM=" tabindex="0" role="tabpanel" aria-hidden="false" aria-labelledby="A1G89bs=" data-name="examplePanel">
<div>
<div class="highlight-code">
<pre class="example microlight language-json" style="display: block; overflow-x: auto; padding: 0.5em; background: #333333; color: white;" tabindex="0"><code class=" language-json" style="white-space: pre;">{
  "status": "success",
  "fileEntry": {
    "id": 0,
    "name": "image.png",
    "file_name": "j6oWHDG1z613UqFHLZpE1Yrqngw0N8XLuGNLNWJV",
    "file_size": 111863,
    "parent_id": 1,
    "parent": "string",
    "thumbnail": "thumbnail.png",
    "mime": "image/png",
    "url": "secure/uploads/3260",
    "hash": "MzI2MHxwYWRkaQ",
    "type": "image",
    "description": "Example description entered by user",
    "deleted_at": "2021-02-23T14:42:38.000000Z",
    "created_at": "2021-02-23T14:42:38.000000Z",
    "updated_at": "2021-02-23T14:42:38.000000Z",
    "path": "3260/3261/3262",
    "users": [
      {
        "id": 0,
        "email": "example@gmail.com"
      }
    ]
  }
}</code></pre>
</div>
</div>
</div>
</div>
</td>
<td class="response-col_links"><em>No links</em></td>
</tr>
<tr class="response " data-code="401">
<td class="response-col_status">401</td>
<td class="response-col_description">
<div class="response-col_description__inner">
<div class="renderedMarkdown">
<p>Unauthenticated. Either access token is not provided or is invalid.</p>
</div>
</div>
</td>
<td class="response-col_links"><em>No links</em></td>
</tr>
<tr class="response " data-code="403">
<td class="response-col_status">403</td>
<td class="response-col_description">
<div class="response-col_description__inner">
<div class="renderedMarkdown">
<p>Unauthorized access. You don't have permissions required to perform this operation.</p>
</div>
</div>
</td>
<td class="response-col_links"><em>No links</em></td>
</tr>
<tr class="response " data-code="422">
<td class="response-col_status">422</td>
<td class="response-col_description">
<div class="response-col_description__inner">
<div class="renderedMarkdown">
<p>Invalid data specified</p>
</div>
</div>
<section class="response-controls">
<div class="response-control-media-type"><small class="response-control-media-type__title">Media type</small>
<div class="content-type-wrapper "><select class="content-type" aria-label="Media Type">
<option value="application/json">application/json</option>
</select></div>
</div>
</section>
<div class="model-example">
<ul class="tab" role="tablist">
<li class="tabitem active" role="presentation"><button id="hVA7fnY=" class="tablinks" role="tab" aria-controls="xVw4gck=" aria-selected="true" data-name="example">Example Value</button></li>
<li class="tabitem" role="presentation"><button id="SHMu+K4=" class="tablinks" role="tab" aria-controls="xPmol38=" aria-selected="false" data-name="model">Schema</button></li>
</ul>
<div id="xVw4gck=" tabindex="0" role="tabpanel" aria-hidden="false" aria-labelledby="hVA7fnY=" data-name="examplePanel">
<div>
<div class="highlight-code">
<pre class="example microlight language-json" style="display: block; overflow-x: auto; padding: 0.5em; background: #333333; color: white;" tabindex="0"><code class=" language-json" style="white-space: pre;">{
  "status": "error",
  "message": "Reason for the error",
  "errors": {
    "some_data_1": "Error message for data 1",
    "some_data_2": "Error message for data 2"
  }
}</code></pre>
</div>
</div>
</div>
</div>
</td>
<a href="https://rediafile.com/>Business Clood Storage</a>
<td class="response-col_links"><em>No links</em></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div><!---->
<a  href="https://developers.rediafile.com/help-center/articles/7/api-upload-files-to-rdiafile">sourcr :API Upload files to Rdiafile</a>