• Figment File Storage
    • Deployment
    • API
    • Packages

API Endpoints

Upload Files to S3

Method: "POST"
URL: https://domain:port/api/v1/upload/:id
body: Formdata
{
    callback_host: String,
    id: String,
    key: String,
    file: File
}

Archive multiple files

Method: "POST"
URL: https://domain:port/api/v1/archive
body: json
{
    name: String,
    uuid: String,
    ts: String,
    list: Array,
    callback: String,
}

The list is an object array made up of names and paths(in S3)

Authentication

In order to access the endpoints the client will require an Authorization Bearer Token. Also the incoming request must provide a callback URL for the microservice to acknowledge the placement of the file in S3. The callback URL must be in the whitelisted list for each endpoint. Using axios the callback URL is called on success of storing the file in S3, passing forward the key, and Authorisation header passed during the request. If the response is anything but a 200 OK request then the file is removed from S3 as if the transaction never happened.

  • Whitelisted Callback URLS prior to XHR request
  • The Authorisation token provided in the callback must be authorised on the Laravel Server otherwise the transaction is rolled back.
Last Updated:
Contributors: Nikhil Gandhi
Prev
Deployment
Next
Packages