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 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/partner/assets/v2.0/organization/{organization_id}/namespaces/{namespace}/upload/complete
# This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
POST
/service/partner/assets/v2.0/organization/{organization_id}/namespaces/{namespace}/upload/start
# This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
GET
/service/partner/assets/v1.0/organization/{organization_id}/namespaces/{namespace}/browse
# Browse Files
POST

This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.

Uploads an arbitrarily sized buffer or blob. It has three Major Steps: * Start * Upload * Complete ### Start Initiates the assets upload using `startUpload`. It returns the storage link in response. ### Upload Use the storage link to upload a file (Buffer or Blob) to the File Storage. Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body. ### Complete After successfully upload, call `completeUpload` api to complete the upload process. This operation will return the url for the uploaded 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.
organization_id
string
Required
This is organization 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
tags
array of string
Response
200
400
Success
FileUploadComplete
_id
string
file_name
string
file_path
string
content_type
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
success
boolean
tags
array of string
created_on
string
| date-time
modified_on
string
| date-time
created_by
object (CreatedBy)
CreatedBy
username
string
Examples
Parameters
namespace:
"test"
organization_id:
"t6hcne7r2ewmc888"
body:
body
POST
/service/partner/assets/v2.0/organization/{organization_id}/namespaces/{namespace}/upload/complete
Loading...
Response
Loading...
POST

This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.

Uploads an arbitrarily sized buffer or blob. It has three Major Steps: * Start * Upload * Complete ### Start Initiates the assets upload using `startUpload`. It returns the storage link in response. ### Upload Use the storage link to upload a file (Buffer or Blob) to the File Storage. Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body. ### Complete After successfully upload, call `completeUpload` api to complete the upload process. This operation will return the url for the uploaded 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.
organization_id
string
Required
This is organization 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
FileUpload
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
tags
array of string
Examples
Parameters
namespace:
"test"
organization_id:
"t6hcne7r2ewmc888"
body:
body
POST
/service/partner/assets/v2.0/organization/{organization_id}/namespaces/{namespace}/upload/start
Loading...
Response
Loading...
GET

Browse Files

Browse Files
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.
organization_id
string
Required
This is organization id
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
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"
organization_id:
"t6hcne7r2ewmc888"
page:
1
limit:
1
GET
/service/partner/assets/v1.0/organization/{organization_id}/namespaces/{namespace}/browse
Loading...
Response
Loading...

URL Signing

Generates signed URLs for secure, temporary access to stored files.

Operations
GET
/service/partner/assets/v1.0/organization/{organization_id}/proxy/fetch
# Proxy
POST
/service/partner/assets/v1.0/organization/{organization_id}/proxy/fetch
# Proxy
POST
/service/partner/assets/v1.0/organization/{organization_id}/sign-urls
# Get signed URLs.
GET

Proxy

Proxy
Parameters
organization_id
string
Required
This is organization id
url
string
Required
url
Response
200
Success
FetchProxyDetails
data
object
support
object
Examples
Parameters
organization_id:
"t6hcne7r2ewmc888"
url:
"https://reqres.in/api/users/2"
GET
/service/partner/assets/v1.0/organization/{organization_id}/proxy/fetch
Loading...
Response
Loading...
POST

Proxy

Proxy
Parameters
organization_id
string
Required
This is organization id
Request body
id
integer
customer
string
quantity
integer
price
number
data
object (ProxyFileData)
ProxyFileData
email
string
password
string
url
string
Response
200
Success
SaveProxy
id
integer
token
string
Examples
Parameters
organization_id:
"t6hcne7r2ewmc888"
body:
body
POST
/service/partner/assets/v1.0/organization/{organization_id}/proxy/fetch
Loading...
Response
Loading...
POST

Get signed URLs.

Generates secure, signed URLs that is valid for certain expiry time for accessing stored files.
Parameters
organization_id
string
Required
This is organization id
Request body
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
SignUrlResult
urls
array of object (SignedUrl)
Signed URL object.
Array of SignedUrl
url
string
This is the original asset URL provided in the request. This is the URL for which a signed URL has been generated.
signed_url
string
Generated signed URL.
expiry
integer
The expiration time for the signed URL in seconds.
Examples
Parameters
organization_id:
"t6hcne7r2ewmc888"
body:
body
POST
/service/partner/assets/v1.0/organization/{organization_id}/sign-urls
Loading...
Response
Loading...