Skip to main content

Storage

Storage supports configured backends such as Azure Blob or AWS S3 through the same API. Uploading is a two-step operation: request a signed URL, then upload bytes directly to that URL.

List storage configurations

GET /logic/v4/Storage/Gets

The response is an array, or an object containing data or items. A configuration's name is passed as configurationName; storageStrategy identifies its backend.

Request an upload URL

POST /data/v4/Files/GetPreSignedUrlForUpload

{
"metaData": "",
"name": "report.pdf",
"parentDirectoryId": "",
"tags": "",
"accessModifier": "Public",
"projectKey": "YOUR_PROJECT_KEY",
"moduleName": 3,
"configurationName": "Default"
}

The response supplies a signed upload URL and file ID. Field casing can vary; the example accepts names including preSignedUrl, url, uploadUrl, fileId, and itemId.

Upload the file bytes

PUT {signedUploadUrl}

Send the raw file body directly to the returned URL. Use the file MIME type as Content-Type. For Azure Blob URLs, also send:

x-ms-blob-type: BlockBlob

Do not send the Blocks project header to a third-party signed URL unless the URL contract explicitly requires it.

List files

POST /data/v4/Files/GetFilesInfo

{
"page": 0,
"pageSize": 50,
"sort": { "property": "createdDate", "isDescending": true },
"filter": {},
"projectKey": "YOUR_PROJECT_KEY"
}

The example reads the file array from data.

Get a download URL

GET /data/v4/Files/GetFile?FileId={fileId}&ConfigurationName={configurationName}

curl --get 'https://api.seliseblocks.com/data/v4/Files/GetFile' \
-H 'x-blocks-key: YOUR_PROJECT_KEY' \
--data-urlencode 'FileId=FILE_ID' \
--data-urlencode 'ConfigurationName=Default'

The response contains a short-lived download URL, either directly as text or in a URL field in the JSON response.