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

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.
body
object (StartRequest)
Required
StartRequest
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
Response
200
400
Success. Returns a response containing relaving and absolute_url of storage service
StartResponse
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
cdn
object (CDN)
CDN
tags
array of string
Tags associated with the file.
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
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
cdn
object (CDN)
Required
CDN
tags
array of string
Tags associated with the file.
Response
200
400
Success
CompleteResponse
_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
cdn
object (CDN)
CDN
success
boolean
The success status of the upload operation.
tags
array of string
Tags associated with the file.
created_on
string
The timestamp when the file was created.
modified_on
string
The timestamp when the file was last modified.
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
The expiration time for the signed URL.
urls
array of string
Required
List of asset URLs to be signed. .
Response
200
Success
SignUrlResponse
urls
array of object (Urls)
Signed URL object.
Array of Urls
Examples
Parameters
body:
body
Was this section helpful?
POST
/service/application/assets/v1.0/sign-urls
Loading...
Response
Loading...