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
namespacepath
string
Required
A classification value that categorizes files based on the namespace used to determine their storage location and validate their data before upload. The namespace also acts as a directory structure within the storage bucket and enforces file-specific rules. Available namespaces: - user-profile-pic: Public namespace allowing images up to 15Mb - feedback-media: Public namespace allowing images and videos up to 1Gb - users-vto-images: Private namespace allowing images up to 40Mb - application-audience: Private namespace allowing images and PDFs up to 50Mb
Enum
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)
Show
POST
/service/application/assets/v2.0/namespaces/{namespace}/upload/start
Loading...
Response
200
400
Success. Returns a response containing relaving and absolute_url of storage service
Hide
Schema provides detailed information about the file storage path, content type, associated metadata, and CDN details.
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)
Show
tags
array of string
Tags associated with the file.
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
namespacepath
string
Required
A classification value that categorizes files based on the namespace used to determine their storage location and validate their data before upload. The namespace also acts as a directory structure within the storage bucket and enforces file-specific rules. Available namespaces: - user-profile-pic: Public namespace allowing images up to 15Mb - feedback-media: Public namespace allowing images and videos up to 1Gb - users-vto-images: Private namespace allowing images up to 40Mb - application-audience: Private namespace allowing images and PDFs up to 50Mb
Enum
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
Show
tags
array of string
Tags associated with the file.
POST
/service/application/assets/v2.0/namespaces/{namespace}/upload/complete
Loading...
Response
200
400
Success
Hide
A comprehensive schema detailing the outcome of a file upload operation, including file metadata, storage details, and the status of the upload.
_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)
Show
cdn
object (CDN)
Show
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)
Show
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.
POST
/service/application/assets/v1.0/sign-urls
Loading...
Response
200
Success
Hide
Schema encapsulates the signed URLs generated for secure file access.
urls
array of object (Urls)
Signed URL object.
Show
Examples
Parameters
body:
body
Response
Loading...