Skip to main content

FileStorage

This service provides functionality to manage assets and generate pdf. You can upload the assets, get the CDN link for the assets, proxy the assets and many more things.

File Upload

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/v1.0/namespaces/{namespace}/upload/start
# Initiate file upload
POST
/service/application/assets/v1.0/namespaces/{namespace}/upload/complete
# Complete file upload
POST

Initiate file upload

Get a signed url for uploading a file
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.
body
object (StartRequest)
Required
StartRequest
file_name
string
Required
content_type
string
Required
size
integer
Required
tags
array of string
params
object (Params)
Params
Response
200
400
Success. Returns a response containing relaving and absolute_url of storage service
StartResponse
file_name
string
file_path
string
content_type
string
method
string
namespace
string
operation
string
size
integer
upload
object (Upload)
Upload
cdn
object (CDN)
CDN
tags
array of string
Examples
Parameters
namespace:
"test"
body:
body
Was this section helpful?
POST
/service/application/assets/v1.0/namespaces/{namespace}/upload/start
Loading...
Response
Loading...
POST

Complete file upload

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.
body
object (StartResponse)
Required
StartResponse
file_name
string
Required
file_path
string
Required
content_type
string
Required
method
string
namespace
string
Required
operation
string
Required
size
integer
Required
upload
object (Upload)
Required
Upload
cdn
object (CDN)
Required
CDN
tags
array of string
Response
200
400
Success
CompleteResponse
_id
string
file_name
string
file_path
string
content_type
string
namespace
string
operation
string
size
integer
upload
object (Upload)
Upload
cdn
object (CDN)
CDN
success
boolean
tags
array of string
created_on
string
modified_on
string
created_by
object (CreatedBy)
CreatedBy
Examples
Parameters
namespace:
"test"
body:
body
Was this section helpful?
POST
/service/application/assets/v1.0/namespaces/{namespace}/upload/complete
Loading...
Response
Loading...

Signed URLs

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
# Get signed URLs
POST

Get signed URLs

Generates secure, signed URLs that is valid for certain expiry time for accessing stored files.
Parameters
body
object (SignUrlRequest)
Required
SignUrlRequest
expiry
integer
Required
urls
array of string
Required
Response
200
Success
SignUrlResponse
urls
array of object (Urls)
Array of Urls
Examples
Parameters
body:
body
Was this section helpful?
POST
/service/application/assets/v1.0/sign-urls
Loading...
Response
Loading...