FileStorage

The File Storage module simplifies your file upload and storage tasks. Use the 'Initiate Upload' module to start and complete file uploads. Once the upload is successful, employ the 'Complete Upload' module to retrieve the file's URL. For added security, utilize the 'Sign URLs' module, which grants authorized access through signed URLs.

File Upload Management

File upload is a feature that enables users to upload files from their device to a designated storage location in the system. The process of uploading begins by validating user parameters and organizing files into different groups based on their type using something called a "namespace". This helps in storing the files into Public and Private buckets Private - The files stored in private bucket is accessible via getSignedUrl method for a temporary duration. Public - The files stored in public bucket is accessible via cdn url Customer initiate the upload process by selecting from pre-existing images, choosing from your device, uploading via URL, or entering an image URL. 1. Start Upload - Once seller calls start upload will receive a signed URL to initiate the upload process. 2. Utilize a Google Cloud Platform (GCP) method to upload the file through the obtained signed URL. 3. Complete File upload - Important file details such as name, size, content type, and namespace are collected and linked to maintain data integrity within the system's database. Once you upload a file, you receive a message with all the details about where your file is stored, including a secure URL for uploading files to the designated storage and a CDN (Content Delivery Network) URL for future accessibility. Furthermore, the system sets an expiration time for access links(signed Url) enhancing security measures.

Operations
POST
/service/application/assets/v2.0/namespaces/{namespace}/upload/start
# Initiates file upload
POST
/service/application/assets/v2.0/namespaces/{namespace}/upload/complete
# Finalizes upload process.
POST

Initiates file upload

Starts the process of uploading a file to storage location, and returns a signed url in response.
Parameters
namespace
string
Required
Segregation of different types of files(products, orders, logistics etc), Required for validating the data of the file being uploaded, decides where exactly the file will be stored inside the storage bucket.
Request body
file_name
string
Required
The name of the file to be uploaded.
content_type
string
Required
The name of the file to be uploaded.
size
integer
Required
The size of the file in bytes.
tags
array of string
Tags associated with the file.
params
object (Params)
Params
subpath
string
Specifies a particular directory or location within the storage structure where the file should be placed or is located.
Response
200
400
Success. Returns a response containing relaving and absolute_url of storage service
FileUpload
file_name
string
The name of the file that was uploaded.
file_path
string
The path to the file in the storage location.
content_type
string
The content type of the file.
method
string
The HTTP method to be used for uploading the file.
namespace
string
The namespace associated with the file.
operation
string
The operation to be performed on the storage service.
size
integer
The size of the file in bytes.
upload
object (Upload)
Upload
expiry
integer
The expiration time for the signed URL.
url
string
The signed URL for uploading the file.
tags
array of string
Tags associated with the file.
Examples
Parameters
namespace:
"test"
body:
body
POST
/service/application/assets/v2.0/namespaces/{namespace}/upload/start
Loading...
Response
Loading...
POST

Finalizes upload process.

Complete the file upload and store the file details such as name, size, content type, and namespace to maintain integrity within the system's database.
Parameters
namespace
string
Required
Segregation of different types of files(products, orders, logistics etc), Required for validating the data of the file being uploaded, decides where exactly the file will be stored inside the storage bucket.
Request body
file_name
string
Required
The name of the file that was uploaded.
file_path
string
Required
The path to the file in the storage location.
content_type
string
Required
The content type of the file.
method
string
The HTTP method to be used for uploading the file.
namespace
string
Required
The namespace associated with the file.
operation
string
Required
The operation to be performed on the storage service.
size
integer
Required
The size of the file in bytes.
upload
object (Upload)
Required
Upload
expiry
integer
Required
The expiration time for the signed URL.
url
string
Required
The signed URL for uploading the file.
tags
array of string
Tags associated with the file.
Response
200
400
Success
FileUploadComplete
_id
string
The unique identifier of the uploaded file.
file_name
string
The name of the file that was uploaded.
file_path
string
The path to the file in the storage location.
content_type
string
The content type of the file.
namespace
string
The namespace associated with the file.
operation
string
The operation performed on the storage service.
size
integer
The size of the file in bytes.
upload
object (Upload)
Upload
expiry
integer
The expiration time for the signed URL.
url
string
The signed URL for uploading the file.
cdn
object (CDN)
CDN
url
string
The CDN URL for accessing the file.
absolute_url
string
The absolute URL of the file.
relative_url
string
The relative URL of the file.
success
boolean
The success status of the upload operation.
tags
array of string
Tags associated with the file.
created_on
string
| date-time
The timestamp when the file was created.
modified_on
string
| date-time
The timestamp when the file was last modified.
created_by
object (CreatedBy)
CreatedBy
username
string
The username of the user who created the file.
Examples
Parameters
namespace:
"test"
body:
body
POST
/service/application/assets/v2.0/namespaces/{namespace}/upload/complete
Loading...
Response
Loading...

URL Signing

The Signed URLs feature is responsible for generating signed URLs for multiple objects, enabling secure access to stored files. You can utilize this feature to create accessible links for the stored resources for a specified period. For example, if you need to download private files from Google Cloud Storage (GCS), this method can generate a secure link for a temporary duration. These links are signed with a cryptographic signature, ensuring secure access to the files within the specified time frame. By providing signed URLs, the Signed URLs feature enhances file access security, making file management more secure and efficient.

Operations
POST
/service/application/assets/v1.0/sign-urls
# Signs file URLs.
POST

Signs file URLs.

Generates secure, signed URLs that is valid for certain expiry time for accessing stored files.
Parameters
No Parameters
Request body
expiry
integer
Required
The expiration time for the signed URL.
urls
array of string
Required
List of asset URLs to be signed.
Response
200
Success
SignUrlResult
urls
array of object (Urls)
Signed URL object.
Array of Urls
url
string
This is the original asset URL provided in the request. This is the URL for which a signed URL has been generated.
signed_url
string
Generated signed URL.
expiry
integer
The expiration time for the signed URL.
Examples
Parameters
body:
body
POST
/service/application/assets/v1.0/sign-urls
Loading...
Response
Loading...