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 Seller initiate the upload process by selecting files through drag-and-drop, 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/platform/assets/v1.0/company/{company_id}/namespaces/{namespace}/upload/start
# Start file upload
POST
/service/platform/assets/v1.0/company/{company_id}/namespaces/{namespace}/upload/complete
# Complete file upload
POST
/service/platform/assets/v1.0/company/{company_id}/sign-urls
# Get signed URLs
POST
/service/platform/assets/v1.0/company/{company_id}/uploads/copy
# Copy files
POST

Start file upload

Inititates the process of uploading a file to storage location, and returns a storage link in response at platform level. Please refer group description for more details.
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.
company_id
integer
Required
This is company id
Request body
file_name
string
Required
content_type
string
Required
size
integer
Required
tags
array of string
params
object
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
expiry
integer
url
string
cdn
object (CDN)
CDN
url
string
absolute_url
string
relative_url
string
tags
array of string
Examples
Parameters
namespace:
"test"
company_id:
2
body:
body
POST
/service/platform/assets/v1.0/company/{company_id}/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 at platform level
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.
company_id
integer
Required
This is company id
Request body
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
expiry
integer
Required
url
string
Required
cdn
object (CDN)
Required
CDN
url
string
Required
absolute_url
string
Required
relative_url
string
Required
tags
array of string
Response
200
400
Success
CompleteResponse
_id
string
file_name
string
file_path
string
content_type
string
namespace
string
operation
string
company_id
number
size
integer
upload
object (Upload)
Upload
expiry
integer
url
string
cdn
object (CDN)
CDN
url
string
absolute_url
string
relative_url
string
success
boolean
tags
array of string
created_on
string
modified_on
string
created_by
object (CreatedBy)
CreatedBy
username
string
Examples
Parameters
namespace:
"test"
company_id:
2
body:
body
POST
/service/platform/assets/v1.0/company/{company_id}/namespaces/{namespace}/upload/complete
Loading...
Response
Loading...
POST

Get signed URLs

Generates secure, signed URLs that is valid for certain expiry time for accessing stored resources inside private bucket.
Parameters
company_id
integer
Required
This is company id
Request body
expiry
integer
Required
urls
array of string
Required
Response
200
Success
SignUrlResponse
urls
array of object (Urls)
Array of Urls
url
string
signed_url
string
expiry
integer
Examples
Parameters
company_id:
2
body:
body
POST
/service/platform/assets/v1.0/company/{company_id}/sign-urls
Loading...
Response
Loading...
POST

Copy files

Handle multiple file uploads, updating progress and providing detailed status reports.
Parameters
sync
boolean
Copy files operation should run in sync mode or not
company_id
integer
Required
This is company id
Request body
urls
array of string
destination
object (DestinationNamespace)
Required
DestinationNamespace
namespace
string
Response
200
400
Success
Properties
tracking_url
string
The URL to track the status of the copy-files task.
task
object
Details about the task being performed.
Properties
id
string
A string representing the unique identifier of the task.
name
string
A string representing the name of the task.
data
object
An object that includes urls, destination.
Properties
urls
array of string
An array of strings, each representing a URL of a file.
destination
object
The destination details for the copied files.
Properties
namespace
string
This is defining namespace.
basepath
string
The base path in the destination where files will be stored.
opts
object
Options for task execution.
Properties
attempts
number
The number of attempts to try the task.
backoff
object
The backoff strategy for retrying the task.
Properties
type
string
The type of backoff strategy.
delay
number
The delay between retries in milliseconds.
delay
number
The delay before starting the task, in milliseconds.
timestamp
number
The timestamp when the task was created.
progress
number
The current progress of the task, as a percentage.
delay
number
The delay before starting the task, in milliseconds.
timestamp
number
The timestamp when the task was created.
attemptsMade
number
The number of attempts that have been made to complete the task.
returnvalue
string
Nullable
The return value of the task upon completion.
finishedOn
string
Nullable
The timestamp when the task was finished.
processedOn
string
Nullable
The timestamp when the task started processing.
stacktrace
array of object
This is defining the The stack trace.
Examples
Parameters
body:
body
POST
/service/platform/assets/v1.0/company/{company_id}/uploads/copy
Loading...
Response
Example not available.

Proxy

The proxy acts as an intermediary, enabling communication between two entities by directing client requests to the correct server and sending responses back to the client. It fetches data from a designated URL and delivers it to the client, ensuring seamless interaction with files. This resource can be employed to provide the client (browser) with cross-domain asset URLs, preventing CORS errors.

Operations
GET
/service/platform/assets/v1.0/company/{company_id}/proxy
# Access files through a proxy
GET

Access files through a proxy

It enables the communication between two entities by directing client requests to the correct server and sending responses back to the client. Please refer group description for more details.
Parameters
company_id
integer
Required
This is company id
url
string
Required
url
Response
200
Success
ProxyResponse
data
object
support
object
Examples
Parameters
company_id:
2
url:
"https://reqres.in/api/users/2"
GET
/service/platform/assets/v1.0/company/{company_id}/proxy
Loading...
Response
Example not available.