Files

Get parameters for uploading files

<div><strong>This API is part of a series of API calls you need to make to upload a file to our system.</strong></div> <details> <summary> Click here to see the APIs alongside code examples using cURL </summary> <ol> <li> <details> <summary> This API. It returns a URL (used in step #2) and the file's path (used in step #3): </summary> <code class="hljs">curl -H "Authorization: Bearer API_KEY" "https://api.toriihq.com/v1.0/files/url?name={FILE_NAME}&type={CONTENT_TYPE}"</code> <hr /> <code class="hljs">curl -H "Authorization: Bearer API_KEY" "https://api.toriihq.com/v1.0/files/url?name=my_file.json&type=text/csv"</code> </details> </li> <li> <details> <summary> Use the URL returned to upload the file directly to S3: </summary> <code class="hljs">curl -H "Content-Type: {CONTENT_TYPE}" --data-binary @'PATH/TO/YOUR/FILE' -X PUT "{S3_URL}"</code> <hr /> <code class="hljs">curl -H "Content-Type: text/csv" --data-binary @'~/Downloads/my_file.json' -X PUT "{S3_URL}"</code> </details> </li> <li> <details> <summary> Look for the 'Store file information in DB' API or use the following code snippet: </summary> <code class="hljs">curl -d '{"path":"{FILE_PATH}","type":"{FILE_TYPE}"}' -H "Authorization: Bearer API_KEY" -H "Content-Type: application/json" "https://api.toriihq.com/v1.0/files"</code> <hr /> <code class="hljs">curl -d '{"path":"1629889604893/my_file.json","type":"expenseReport"}' -H "Authorization: Bearer API_KEY" -H "Content-Type: application/json" "https://api.toriihq.com/v1.0/files"</code> </details> </li> </ol> </details> <p><ul><li>Rate limit: 200 requests per minute</li></ul></p>
get/files/url

Request

  • Base URL
    https://api.toriihq.com/v1.0
  • Auth
    API key in header Authorization

Query parameters

namestring required

File name

typestring required

Response

Upload File Parameters

Example response

{
  "uploadFileParameters": {
    "filePath": "1612686123657/test_file.xlsx"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.