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.

Browse File

Browse files by fetching all files in a directory based on the provided namespace, query, and request body parameters. It determines the directory path, retrieves paginated files accordingly, and serializes the response for further processing. This method optimizes directory browsing functionality within the system.

Operations
GET
/service/platform/assets/v1.0/company/{company_id}/namespaces/{namespace}/browse
# Browse files.
GET

Browse files.

View and navigate through available files.
Requires company/assets/read access scope.
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
Unique numeric identifier for the company.
page
integer
page no
limit
integer
Limit
Response
200
400
Success
Properties
items
array of object
Array of Properties
_id
string
file_name
string
file_path
string
success
boolean
namespace
string
content_type
string
size
number
operation
string
tags
array of string
cdn
object
Properties
url
string
upload
object
Properties
url
string
expiry
number
created_by
object
Properties
username
string
user_id
string
company_id
number
bucket_key
string
created_at
string
updated_at
string
__v
number
page
object
Properties
item_total
integer
| int32
next_id
string
has_previous
boolean
has_next
boolean
current
integer
| int32
type
string
size
integer
| int32
Examples
Parameters
namespace:
"test"
company_id:
2
page:
1
limit:
1
GET
/service/platform/assets/v1.0/company/{company_id}/namespaces/{namespace}/browse
Loading...
Response
Loading...

File Transfer

Enable seamless file management within application and across external sources. It copy files, ensuring data replication and backup for various purposes. Additionally, browse, navigate, and utilize proxy functionality for interacting with files and performing operations on them within the platform

Operations
POST
/service/platform/assets/v1.0/company/{company_id}/uploads/copy
# Copy files.
POST

Copy files.

Duplicate files to another location.
Requires company/assets/write access scope.
Parameters
sync
boolean
Determines whether the copy files operation should run in synchronous mode.
company_id
integer
Required
Unique numeric identifier for the company.
Request body
urls
array of string
List of URLs of files to be copied.
destination
object (DestinationNamespace)
Required
DestinationNamespace
namespace
string
The target namespace for copied files.
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
company_id:
2
body:
body
POST
/service/platform/assets/v1.0/company/{company_id}/uploads/copy
Loading...
Response
Loading...

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/platform/assets/v2.0/company/{company_id}/namespaces/{namespace}/upload/start
# Start file upload.
POST
/service/platform/assets/v2.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

Start file upload.

Inititates the process of uploading a file to storage location, and returns a storage link in response.
Requires company/assets/write access scope.
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
Unique numeric identifier for the company.
Request body
file_name
string
Required
The name of the file to be uploaded.
content_type
string
Required
The MIME type of the file.
size
integer
Required
The file size in bytes.
tags
array of string
Tags associated with the file.
params
object
Additional parameters for file upload.
Response
200
400
Success. Returns a response containing relaving and absolute_url of storage service
FileUpload
file_name
string
The name of the uploaded file.
file_path
string
The storage path of the uploaded file.
content_type
string
The MIME type of the file.
method
string
The HTTP method used for uploading the file.
namespace
string
The namespace under which the file is stored.
operation
string
The operation type related to the file upload.
size
integer
The size of the file in bytes.
upload
object (Upload)
Upload
expiry
integer
The time in milliseconds before the signed URL expires.
url
string
The signed URL for uploading a file.
tags
array of string
A list of tags associated with the file.
Examples
Parameters
namespace:
"test"
company_id:
2
body:
body
POST
/service/platform/assets/v2.0/company/{company_id}/namespaces/{namespace}/upload/start
Loading...
Response
Loading...
POST

Complete file upload.

Starts the process of uploading a file to storage location, and returns a storage link in response.
Requires company/assets/write access scope.
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
Unique numeric identifier for the company.
Request body
file_name
string
Required
The name of the uploaded file.
file_path
string
Required
The storage path of the uploaded file.
content_type
string
Required
The MIME type of the file.
method
string
The HTTP method used for uploading the file.
namespace
string
Required
The namespace under which the file is stored.
operation
string
Required
The operation type related to the file upload.
size
integer
Required
The size of the file in bytes.
upload
object (Upload)
Required
Upload
expiry
integer
Required
The time in milliseconds before the signed URL expires.
url
string
Required
The signed URL for uploading a file.
tags
array of string
A list of 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 uploaded file.
file_path
string
The storage path of the file.
content_type
string
The MIME type of the file.
namespace
string
The namespace where the file is stored.
operation
string
The operation performed on the file.
company_id
number
The ID of the company associated with the file.
size
integer
The file size in bytes.
upload
object (Upload)
Upload
expiry
integer
The time in milliseconds before the signed URL expires.
url
string
The signed URL for uploading a file.
cdn
object (CDN)
CDN
url
string
The full URL to access the file via the CDN.
absolute_url
string
The absolute URL of the file stored in the CDN.
relative_url
string
The relative path to the file within the CDN.
success
boolean
Indicates if the file upload was successful.
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 creator.
user_id
string
The unique identifier of the user.
Examples
Parameters
namespace:
"test"
company_id:
2
body:
body
POST
/service/platform/assets/v2.0/company/{company_id}/namespaces/{namespace}/upload/complete
Loading...
Response
Loading...
POST

Get signed URLs.

Retrieve signed URLs for file access.
Requires company/assets/write access scope.
Parameters
company_id
integer
Required
Unique numeric identifier for the company.
Request body
expiry
integer
Required
The expiration time (in milliseconds) for the signed URL.
urls
array of string
Required
List of URLs to be signed.
Response
200
Success
SignUrlResult
urls
array of object (Urls)
A list of signed URLs.
Array of Urls
url
string
The public URL of the file.
signed_url
string
The signed URL with access permissions.
expiry
integer
The expiration time (in milliseconds) for the signed URL.
Examples
Parameters
company_id:
2
body:
body
POST
/service/platform/assets/v1.0/company/{company_id}/sign-urls
Loading...
Response
Loading...

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
# Proxy file access.
GET

Proxy file access.

Access files through a proxy.
Requires company/assets/read access scope.
Parameters
company_id
integer
Required
Unique numeric identifier for the company.
url
string
Required
url
Response
200
Success
ProxyFileAccess
data
object
The data related to file access.
support
object
Additional support information.
Examples
Parameters
company_id:
2
url:
"https://reqres.in/api/users/2"
GET
/service/platform/assets/v1.0/company/{company_id}/proxy
Loading...
Response
Loading...