ES-Authorization
, ES-File
values to authenticate the request.ES-Slot
name of storage slot.ES-Authorization
, ES-File
, ES-Slot
HTTP header to your tus request.FileName_Key = HMAC_SHA256(Uri-Encode(<FileName>), <AccessKey>); FileNameSlot_Key = HMAC_SHA256(<FileName_Key>, <SlotName>); FileNameSlotSize_Key = HMAC_SHA256(<FileNameSlot_Key>, <FileSizeInBytes>); FileNameSlotSizeLocation = <FileNameSlotSize_Key> + <SecretKey> + Uri-Encode(<FileLocation>); FileNameSlotSizeLocation_Key = HMAC_SHA256(<FileNameSlotSizeLocation>, “ES-S4-TUS-V1”); Signature = HEX(HMAC_SHA256(<FileNameSlotSizeLocation_Key>, <ExpiresInTimestamp>)); Header[‘ES-Authorization’] = v1.0/ES-S4-TUS-V1/<AccessKey>/<Signature>/<ExpiresInTimestamp> Header[‘ES-Slot’] = <SlotName> Header[‘ES-File’] = BASE64_ENCODE("{ ‘location’ : Uri-Encode(<FileLocation>), ‘name’ : Uri-Encode(<FileName>), ‘size’ : <FileSizeInBytes> }");
FileName
and FileSize
are the attributes of file that to be upload, You can use custom name for the file.AccessKey
and SecretKey
are the authorization strings those are available at es-api page.FileLocation
location of file to be uploaded at EmbedSpace storage slot, location format.SlotName
Storage slot name on EmbedSpace, or your EmbedSpace username.$fileName = '2008/Videos/Animated/';
$fileLocation = ''; //keep standard (folder/subfolder/)
$fileSize = ''; //file size in Bytes
$slotName = 'xxxxxx';
$base = '';
$accessKey = 'ACCESSKEY';
$secretKey = 'SECRETKEY';
$fileName = rawurlencode(($fileName);
$fileLocation = rawurlencode($fileLocation);
$expires = strtotime('+1 hour');
$fileNameKey = hash_hmac('sha256', $fileName, $accessKey, true);
$fileNameSlotKey = hash_hmac('sha256', $slotName, $fileNameKey, true);
$fileNameSlotSizeKey = hash_hmac('sha256', $fileSize, $fileNameSlotKey, true);
$fileNameSlotSizeLocation = $fileNameSlotSizeKey . $secretKey . $fileLocation;
$fileNameSlotSizeLocationKey = hash_hmac('sha256', "ES-S4-TUS-V1", $fileNameSlotSizeLocation, true);
$signature= hash_hmac('sha256', $expires, $fileNameSlotSizeLocationKey, false);
$header_es_authorization = 'v1.0/ES-S4-TUS-V1/'.$accessKey.'/'.$signature.'/'.$expires;
$header_es_slot = $slotName;
$header_es_file = base64_encode(json_encode([
'name' => $fileName,
'location' => $fileLocation,
'size' => $fileSize
]));
https://tus.myslot.es/files/
.400, Bad Request, 401, Unauthorized (Signature Does Not Match), 402, Payment Required, 403, Forbidden (Unauthorized), 404, Not Found, 405, Method Not Allowed, 406, Not Acceptable, 407, Proxy Authorization Required, 408, Request Timeout, 426, Upgrade Required(Make your Account as Premium)
var file = th.files[0];
var file_location = '2008/Videos/Animated/';
var file_type = 'binary/octet-stream';
var authorization_header = getAuth(file.name,file_location,file.size); // Get authorization header
var tus_upload = {
endpoint: 'https://tus.myslot.es/files/',
retryDelays: [0, 1000, 3000, 5000],
overridePatchMethod: true,
chunkSize: 5242880,
metadata: {
name: file.name,
location: file_location,
type: file_type
},
headers : {
"ES-Authorization": authorization_header,
"ES-Slot": slotName,
"ES-File": file_header
},
removeFingerprintOnSuccess:true,
onProgress: function (bytesUploaded, bytesTotal){
console.log(bytesUploaded,bytesTotal);
},
onSuccess: function () {
console.log('UPLOAD SUCCESS');
}
};
var new_tus = new tus.Upload(file,tus_upload);
try{
new_tus.start();
}catch (e){
console.log('Tus error ' + e.name + ":" + e.message + "\n" + e.stack);
}
ES-Authorization
, ES-File
values to authenticate the request.ES-Slot
name of storage slot.ES-Authorization
, ES-File
, ES-Slot
HTTP header to your tus request.Signature
using HMAC-SHA256 signing algorithm.FileId_Key = HMAC_SHA256(<FileId>, <AccessKey>); FileIdSlot_Key = HMAC_SHA256(<FileId_Key>, <SlotName>); FileIdSlotSize_Key = HMAC_SHA256(<FileIdSlot_Key>, <FileSizeInBytes>); FileIdSlotSizeFv_Key = HMAC_SHA256(<FileIdSlotSize_Key>, “ES-S4-TUS-V1-FV”); FileIdSlotSizeFvSc_Key = HMAC_SHA256(<FileIdSlotSizeFv_Key>, <SecretKey>); Signature = HEX(HMAC_SHA256(<FileIdSlotSizeFvSc_Key>, <ExpiresInTimestamp>)); Header[‘ES-Authorization’] = v1.0/ES-S4-TUS-V1-FV/<AccessKey>/<Signature>/<ExpiresInTimestamp> Header[‘ES-Slot’] = <SlotName> Header[‘ES-File’] = BASE64_ENCODE("{ ‘id’ : <FileId>, ‘size’ : <FileSizeInBytes> }");
FileId
from file details. FileSize
Size of file to be uploaded in bytes.AccessKey
and SecretKey
are the authorization strings those are available at es-api page.$fileId = ''; //from file details
$fileSize = ''; //file size in Bytes
$slotName = 'xxxxxx';
$accessKey = 'ACCESSKEY';
$secretKey = 'SECRETKEY';
$expires = strtotime('+1 hour');
$fileIdKey = hash_hmac('sha256', $fileId, $accessKey, true);
$fileIdSlotKey = hash_hmac('sha256', $slotName, $fileIdKey, true);
$fileIdSlotSizeKey = hash_hmac('sha256', $fileSize, $fileIdSlotKey, true);
$fileIdSlotSizeFvKey = hash_hmac('sha256', "ES-S4-TUS-V1-FV", $fileIdSlotSizeKey, true);
$fileIdSlotSizeFvScKey = hash_hmac('sha256', $secretKey, $fileIdSlotSizeFvKey, true);
$signature = hash_hmac('sha256', $expires, $fileIdSlotSizeFvScKey, false);
$header_es_authorization = 'v1.0/ES-S4-TUS-V1-FV/'.$accessKey.'/'.$signature.'/'.$expires;
$header_es_slot = $slotName;
$header_es_file = base64_encode(json_encode([
'id' => $fileId,
'size' => $fileSize
]));
https://tus.myslot.es/files/
. If any of the syntax mentioned above is fails. Our end point will responds with standard HTTP Status Codes.ES-Authorization
, ES-File
values to authenticate the request.ES-Slot
name of storage slot.ES-Authorization
, ES-File
, ES-Slot
HTTP header to your tus request.Signature
using HMAC-SHA256 signing algorithm.FileName_Key = HMAC_SHA256(Uri-Encode(<FileName>), <AccessKey>); FileNameSlot_Key = HMAC_SHA256(<FileName_Key>, <SlotName>); FileNameSlotSize_Key = HMAC_SHA256(<FileNameSlot_Key>, <FileSizeInBytes>); FileNameSlotSizeLocation = <FileNameSlotSize_Key> + <SecretKey> + Uri-Encode(<FileLocation>); FileNameSlotSizeLocation_Key = HMAC_SHA256(<FileNameSlotSizeLocation>, “ES-S4-POST-V1”); Signature = HEX(HMAC_SHA256(<FileNameSlotSizeLocation_Key>, <ExpiresInTimestamp>)); Header[‘ES-Authorization’] = v1.0/ES-S4-POST-V1/<AccessKey>/<Signature>/<ExpiresInTimestamp> Header[‘ES-Slot’] = <SlotName> Header[‘ES-File’] = BASE64_ENCODE("{ ‘location’ : Uri-Encode(<FileLocation>), ‘name’ : Uri-Encode(<FileName>), ‘size’ : <FileSizeInBytes> }");
FileName
and FileSize
are the attributes of file that to be upload, You can use custom name for the file.AccessKey
and SecretKey
are the authorization strings those are available at es-api page.FileLocation
location of file to be uploaded at EmbedSpace storage slot, location format.SlotName
Storage slot name on EmbedSpace, or your EmbedSpace username.$fileName = '2008/Videos/Animated/';
$fileLocation = ''; //keep standard (folder/subfolder/)
$fileSize = ''; //file size in Bytes
$slotName = 'xxxxxx';
$base = '';
$accessKey = 'ACCESSKEY';
$secretKey = 'SECRETKEY';
$fileName = urlencode($fileName);
$fileLocation = urlencode($fileLocation);
$expires = strtotime('+1 hour');
$fileNameKey = hash_hmac('sha256', $fileName, $accessKey, true);
$fileNameSlotKey = hash_hmac('sha256', $slotName, $fileNameKey, true);
$fileNameSlotSizeKey = hash_hmac('sha256', $fileSize, $fileNameSlotKey, true);
$fileNameSlotSizeLocation = $fileNameSlotSizeKey . $secretKey . $fileLocation;
$fileNameSlotSizeLocationKey = hash_hmac('sha256', "ES-S4-POST-V1", $fileNameSlotSizeLocation, true);
$signature= hash_hmac('sha256', $expires, $fileNameSlotSizeLocationKey, false);
$header_es_authorization = 'v1.0/ES-S4-POST-V1/'.$accessKey.'/'.$signature.'/'.$expires;
$header_es_slot = $slotName;
$header_es_file = base64_encode(json_encode([
'name' => $fileName,
'location' => $fileLocation,
'size' => $fileSize
]));
https://post.myslot.es/files/
.400, Bad Request, 401, Unauthorized (Signature Does Not Match), 402, Payment Required, 403, Forbidden (Unauthorized), 404, Not Found, 405, Method Not Allowed, 406, Not Acceptable, 407, Proxy Authorization Required, 408, Request Timeout, 426, Upgrade Required(Make your Account as Premium)
var file = th.files[0];
var file_location = '2008/Videos/Animated/';
var file_type = 'binary/octet-stream';
var formdata = new FormData();
formdata.append("file",obj.file);
formdata.append("metadata",JSON.stringify({
name: filename,
location: file_location,
type: file_type
}));
var xhr = new XMLHttpRequest();
xhr.upload.addEventListener("progress",function(e){
e = e || event;
console.log(e.total,e.loaded);
document.getElementById('uploadprogress').innerHTML = ((bytesUploaded/bytesTotal)*100).toFixed(2)+'%';
}, false);
xhr.addEventListener("load",function(e){
e = e || event;
console.log(e.target.responseText);
if(this.status===200){
console.log('UPLOAD SUCCESS');
}
else{
console.log('UPLOAD FAIL');
}
}, false);
xhr.addEventListener("error",function(e){
e = e || event;
console.log('UPLOAD FAIL');
}, false);
xhr.open("POST",'https://post.myslot.es/files/',true);
xhr.setRequestHeader("ES-Authorization",authorization_header);
xhr.setRequestHeader("ES-Slot",slotName);
xhr.setRequestHeader("ES-File",file_header);
xhr.send(formdata);
ES-Authorization
, ES-File
values to authenticate the request.ES-Slot
name of storage slot.ES-Authorization
, ES-File
, ES-Slot
HTTP header to your tus request.Signature
using HMAC-SHA256 signing algorithm.FileId_Key = HMAC_SHA256(<FileId>, <AccessKey>); FileIdSlot_Key = HMAC_SHA256(<FileId_Key>, <SlotName>); FileIdSlotSize_Key = HMAC_SHA256(<FileIdSlot_Key>, <FileSizeInBytes>); FileIdSlotSizeFv_Key = HMAC_SHA256(<FileIdSlotSize_Key>, “ES-S4-POST-V1-FV”); FileIdSlotSizeFvSc_Key = HMAC_SHA256(<FileIdSlotSizeFv_Key>, <SecretKey>); Signature = HEX(HMAC_SHA256(<FileIdSlotSizeFvSc_Key>, <ExpiresInTimestamp>)); Header[‘ES-Authorization’] = v1.0/ES-S4-POST-V1-FV/<AccessKey>/<Signature>/<ExpiresInTimestamp> Header[‘ES-Slot’] = <SlotName> Header[‘ES-File’] = BASE64_ENCODE("{ ‘id’ : <FileId>, ‘size’ : <FileSizeInBytes> }");
FileId
from file details. FileSize
Size of file to be uploaded in bytes.AccessKey
and SecretKey
are the authorization strings those are available at es-api page.$fileId = ''; //from file details
$fileSize = ''; //file size in Bytes
$slotName = 'xxxxxx';
$accessKey = 'ACCESSKEY';
$secretKey = 'SECRETKEY';
$expires = strtotime('+1 hour');
$fileIdKey = hash_hmac('sha256', $fileId, $accessKey, true);
$fileIdSlotKey = hash_hmac('sha256', $slotName, $fileIdKey, true);
$fileIdSlotSizeKey = hash_hmac('sha256', $fileSize, $fileIdSlotKey, true);
$fileIdSlotSizeFvKey = hash_hmac('sha256', "ES-S4-POST-V1-FV", $fileIdSlotSizeKey, true);
$fileIdSlotSizeFvScKey = hash_hmac('sha256', $secretKey, $fileIdSlotSizeFvKey, true);
$signature = hash_hmac('sha256', $expires, $fileIdSlotSizeFvScKey, false);
$header_es_authorization = 'v1.0/ES-S4-POST-V1-FV/'.$accessKey.'/'.$signature.'/'.$expires;
$header_es_slot = $slotName;
$header_es_file = base64_encode(json_encode([
'id' => $fileId,
'size' => $fileSize
]));
https://post.myslot.es/files/
. If any of the syntax mentioned above is fails. Our end point will responds with standard HTTP Status Codes.download-as
, to force download the requested resource.version
, By default, the GET operation returns the current version of the file. To return a different version, pass the version number of the file.version-id
, Pass the version id of the file. You will version-id from file version details.auth-method
, This is required parameter. It helps our servers to identify authorization method to authenticate incoming request.expires
, The expires parameter is must always be included. It allows you to control exactly for how long the signed request is valid. It is a UNIX timestamp based time representation. Any request after this timestamp will be rejected.signature
, The signature parameter is the main key in signing the URL. It represents a SHA256 hash based on the requested resource.User_Key = HEX(HMAC_SHA256(<AccessKey>, <SecretKey>)); UserFilePath_Key = HEX(HMAC_SHA256(<User_Key>, Uri-Encode(<FilePath>))); //URL-encode according to RFC 3986 UserFilePathS4DA_Key = HEX(HMAC_SHA256(<UserFilePath_Key>, “ES-S4-DA-V1”)); UserFilePathS4DA_Key = <UserFilePathS4DA_Key> + <ClientIP>; //<ClientIP> is optional. Signature = HEX(HMAC_SHA256(<UserFilePathS4DA_Key>, <ExpiresInTimestamp>));
https://myslot.es/<slotname>/<FilePath>?access-key=<AccessKey>&auth-method=ES-S4-DA-V1&expires=<ExpiresInTimestamp>&signature=<Signature>
https://<slotname>.myslot.es/<FilePath>?access-key=<AccessKey>&auth-method=ES-S4-DA-V1&expires=<ExpiresInTimestamp>&signature=<Signature>
response-content-type
response-content-language
response-cache-control
response-content-disposition
response-content-encoding
$filePath = '2008/Images/Animated/building.jpg';
$expires = strtotime('+1 hour');
$slot = "SLOTNAME";
$accessKey = 'ACCESSKEY';
$secretKey = 'SECRETKEY';
$path = 'FILE_PATH(INCLUDING SLOTNAME IF FORMAT IS 1)';
/*--------------------With out IP validation--------------------*/
$userKey = hash_hmac('sha256', $secretKey, $accessKey, false);
$userFilePathKey = hash_hmac('sha256', rawurlencode($path), $userKey, false);
$userFilePathS4DAKey = hash_hmac('sha256', 'ES-S4-DA-V1', $userFilePathKey, false);
$signature = hash_hmac('sha256', $expires, $userFilePathS4DAKey, false);
/*----------------------With IP validation----------------------*/
$clientIP = "xxx.xxx.xxx.xxx";
$userKey = hash_hmac('sha256', $secretKey, $accessKey, false);
$userFilePathKey = hash_hmac('sha256', rawurlencode($path), $userKey, false);
$userFilePathS4DAKey = hash_hmac('sha256', 'ES-S4-DA-V1', $userFilePathKey, false);
$userFilePathS4DAKey_IP = $userFilePathS4DAKey . $clientIP;
$signature = hash_hmac('sha256', $expires, $userFilePathS4DAKey, false);
ES-Authorization
header with your authorization strings and add it as HTTP header to your request. You can find authorization strings at es-api tab, in the My Account section. All requests must be made over HTTPS to the end point https://api.embedspace.com
. This api-authorization is valid only for operations on the storage. API requests without authorization header will fail.ES-Authorization
header to interact with the EmbedSpace API.Signature
using HMAC-SHA256 signing algorithm.Request_Key = HMAC_SHA256(<Request>, <AccessKey>); RequestVersion_Key = HMAC_SHA256(<Request_Key>, “v1.0”); RequestVersionEx_Key = HMAC_SHA256(<RequestVersion_Key>, <Expires>); Signature = HEX(HMAC_SHA256(<RequestVersionEx_Key>, <SecretKey>)); Header[‘ES-Authorization’] = v1.0/<AccessKey>/<Signature>/<Expires>
Request
operation on files or,folders stored in EmbedSpace cloud storage eg: file/copy-files, file/get-versioning, folder/create-folder, etc...AccessKey
and SecretKey
are the authorization strings those are available at es-api page.$request = 'folder/delete';
$accessKey = 'ACCESSKEY';
$secretKey = 'SECRETKEY';
$expires = strtotime('+1 minute');
$requestKey = hash_hmac('sha256', $accessKey, $request, true);
$requestVersionKey = hash_hmac('sha256', "v1.0", $requestKey, true);
$requestVersionExKey = hash_hmac('sha256', $expires, $requestVersionKey, true);
$signature = hash_hmac('sha256', $secretKey, $requestVersionExKey, false);
$header_es_authorization = 'v1.0/'.$accessKey.'/'.$signature.'/'.$expires;
slot
, type: string, required EmbedSpace storage slot name (username).files
, type: array, required Specifies the source file(s) for the copy operation. You specify the values in mentioned formats.copy_to
, type: string, required Path in the user's slot that is the destination.create_folder
, type: boolean, default: true Create new folder or folders if the destination does not exists. If it is false return error.{
"slot": "myslot",
"files": [
"d:e8fc19d1153eb/Images/Animated/Copy of sample1.png",
"d:e8fc19d1153eb/Images/Films/sample.jpg",
"d:1a131c5a888c9/Copy of sample2.png",
"2008/Images/Animated/Copy of Untitled22.jpg",
"f:2a131c5a888c3"
],
"copy_to": "2008/Images/Copied2/",
"create_folder": true
}
{
"status": 200,
"response": "OK",
"request": "file/copy-files",
"data": {
"new_files": [
{
"id": "6585f603905703",
"name": "Copy of sample1.png"
},
{
"id": "b81d7a32ddf8ea",
"name": "sample.jpg"
},
...
]
}
}
new_files
,New file info type: array Name and Id of each file newly created by this request.id
, type: string A unique identifier for the file.name
, type: string The last component of the path (including extension). This never contains a slash.message
, type: string Message related to the request. eg: Storage limit, etc.slot
, type: string, required EmbedSpace storage slot name (username).file
, type: string, required Specifies the source file which you want to list versions.start_from
, type: integer, default: 0 Where you want to start listing from. EmbedSpace starts listing after this specified value in the order of created time. If it is 0 start listing from beginning.max_results
, type: integer, default: 100, max: 100 Sets the maximum number of version-details returned in the response. The operation returns up to 100 versions by default.{
"slot": "myslot",
"file": "2008/Images/Animated/Copy of Untitled22.jpg",
"start_from": 30,
"max_results": 50
}
{
"status": 200,
"response": "OK",
"request": "file/list-versions",
"data": {
"file_id": "f81d7a32ddf8ea",
"versions": [
{
"id": "723c407fb23df61094b5278c1570e78d",
"created_by": "105984344",
"created_at": 405984548,
"current_version": true,
"size": 5899459,
"type": "application/octet-stream"
},
{
"id": "78e5b55202cbb0916154e8d65c21f70d",
...
}
...
],
"list_end": false
}
}
file_id
, type: string A unique identifier for the file.versions
,Version Info type: array Information about version.id
, type: string A unique identifier for the version.created_by
, type: string The account ID of the user.created_at
, type: integer The Unix timestamp of when the user created this version.current_version
, type: boolean This is the current version of the file.size
, type: integer The file size in bytes.type
, type: string A standard MIME type describing the format of the file data.list_end
, type: boolean Represent list is ended.slot
, type: string, required EmbedSpace storage slot name (username).files
, type: array, required Specifies the file(s) to set public-access permission. You specify the values in mentioned formats.public_access
, type: boolean, required setting public-access permission of file(s).{
"slot": "myslot",
"files": [
"d:e8fc19d1153eb4/Images/Animated/Copy of sample1.png",
"d:e8fc19d1153eb4/Images/Films/sample.jpg",
"d:1a131c5a888c9/Copy of sample2.png",
"2008/Images/Animated/Copy of Untitled22.jpg",
"f:2a131c5a888c3"
],
"public_access": true
}
{
"status": 200,
"response": "OK",
"request": "file/public-access",
"data": {}
}
slot
, type: string, required EmbedSpace storage slot name (username).files
, type: array, required Specifies the file(s) for delete. You specify the values in mentioned formats.permanent
, type: boolean, required If it is true file(including all versions) will be deleted permanently, else go to trash.{
"slot": "myslot",
"files": [
"d:e8fc19d1153eb4/Images/Animated/Copy of sample1.png",
"d:e8fc19d1153eb4/Images/Films/sample.jpg",
"d:1a131c5a888c9/Copy of sample2.png",
"2008/Images/Animated/Copy of Untitled22.jpg",
"f:2a131c5a888c3"
],
"permanent": true
}
{
"status": 200,
"response": "OK",
"request": "file/delete",
"data": {
"deleted_at": 45426889
}
}
slot
, type: string, required EmbedSpace storage slot name (username).file
, type: array, required Specifies the file(s) for delete. You specify the values in mentioned formats.version_id
, type: string,array, required, if version_number is empty Used to reference specific version or versions of the file.version_number
, type: integer, required, if version_id is empty Used to reference a specific version of the file. The numbering is based on creation time.{
"slot": "myslot",
"file": "f:af08245bfe0f9b6",
"version_id": [
"40ff6097d6e57f5785bf0b8b3c0d9c97",
"420c2a180ba010b2b0af3cf1b5d0f97e"
]
}
{
"status": 200,
"response": "OK",
"request": "file/delete-version",
"data": {
"deleted_versions": [
{
"version_id": "420c2a180ba010b2b0af3cf1b5d0f97e",
"deleted_at": 1615476187
},
{
"version_id": "40ff6097d6e57f5785bf0b8b3c0d9c97",
"deleted_at": 1615476187
}
]
}
}
deleted_versions
,Version info type: array List of deleted version.version_id
, type: string A unique identifier for the version.deleted_at
, type: integer The Unix timestamp of when the user deleted the version.slot
, type: string, required EmbedSpace storage slot name (username).files
, type: array, required Specifies the file(s) to get versioning properties. You specify the values in mentioned formats.{
"slot": "myslot",
"files": [
"d:e8fc19d1153eb4/Images/Animated/Copy of sample1.png",
"d:e8fc19d1153eb4/Images/Films/sample.jpg",
"d:1a131c5a888c9/Copy of sample2.png",
"2008/Images/Animated/Copy of Untitled22.jpg",
"f:2a131c5a888c3"
],
}
{
"status": 200,
"response": "OK",
"request": "file/get-versioning",
"data": {
"versions_control": [
{
"file_id": "fab57723c9ddb",
"min_versions_keep_forever": 15,
"delete_previous_versions_after": 35
},
{
"file_id": "2a131c5a888c3",
"min_versions_keep_forever": 15,
"delete_previous_versions_after": 35
},
...
]
}
}
versions_control
,Version control info type: array List of versioning properties of files.file_id
, type: string A unique identifier for the file.min_versions_keep_forever
, type: integer Zero(0) means unlimted versions. If you want to set limit then 9999 is maximum. EmebdSpace will keep the versions forever until you delete or minimizing the limits.delete_previous_versions_after
, type: integer Zero(0) means if new version of the file is created then older version(s) instantly deleted with keeping minimum versions you set.slot
, type: string, required EmbedSpace storage slot name (username).files
, type: array, required Specifies the file(s) to set versioning. You specify the values in mentioned formats.min_versions_keep_forever
, type: integer Zero(0) means unlimted versions. If you want to set limit then 9999 is maximum. EmebdSpace will keep the versions forever until you delete or minimizing the limits.delete_previous_versions_after
, type: integer In days (max: 999), Zero(0) means if new version of the file is created then older version(s) instantly deleted with keeping minimum versions you set.{
"slot": "myslot",
"files": [
"d:e8fc19d1153eb4/Images/Animated/Copy of sample1.png",
"d:e8fc19d1153eb4/Images/Films/sample.jpg",
"d:1a131c5a888c9/Copy of sample2.png",
"2008/Images/Animated/Copy of Untitled22.jpg",
"f:2a131c5a888c3"
],
"min_versions_keep_forever": 35
"delete_previous_versions_after": 45
}
{
"status": 200,
"response": "OK",
"request": "file/set-versioning",
"data": {}
}
slot
, type: string, required EmbedSpace storage slot name (username).file
, type: string, required Specifies the file to list tags. You specify the values in mentioned formats.start_from
, type: integer, default: 0 Where you want to start listing from. Starts listing after this specified value the list begins in ascending order of tag name. If it's 0, start at the beginning of the list.max_results
, type: integer, default: 100, max: 100 The maximum number of tags that will be returned in a response. The action returns up to 100 key names by default.{
"slot": "myslot",
"file": "f:af08245bfe0f9b6"
}
{
"status": 200,
"response": "OK",
"request": "file/list-tags",
"data": {
"tags": [
{
"name": "india",
"attached_by": "47544096"
},
{
"name": "kerala",
"attached_by": "47544096"
},
{
"name": "munnar",
"attached_by": "47544096"
}
]
}
}
tags
,Tag info type: array The list of file tags.name
, type: string name of the tag.attached_by
, type: string The account ID of the user.slot
, type: string, required EmbedSpace storage slot name (username).files
, type: array, required Specifies the file(s) to add tags. You specify the values in mentioned formats.{
"slot": "myslot",
"files": [
"d:e8fc19d1153eb4/Images/Animated/Copy of sample1.png",
"d:e8fc19d1153eb4/Images/Films/sample.jpg",
"d:1a131c5a888c9/Copy of sample2.png",
"2008/Images/Animated/Copy of Untitled22.jpg",
"f:2a131c5a888c3"
],
"tags": [
{
"name": "sample tag1"
},
{
"name": "sample tag2"
},
{
"name": "sample tag3"
}
]
}
{
"status": 200,
"response": "OK",
"request": "file/add-tags",
"data": {}
}
slot
, type: string, required EmbedSpace storage slot name (username).files
, type: array, required Specifies the file(s) to remove tags. You specify the values in mentioned formats.{
"slot": "myslot",
"files": [
"d:e8fc19d1153eb4/Images/Animated/Copy of sample1.png",
"d:e8fc19d1153eb4/Images/Films/sample.jpg",
"d:1a131c5a888c9/Copy of sample2.png",
"2008/Images/Animated/Copy of Untitled22.jpg",
"f:2a131c5a888c3"
],
"tags": [
{
"name": "sample tag1"
},
{
"name": "sample tag2"
},
{
"name": "sample tag3"
}
]
}
{
"status": 200,
"response": "OK",
"request": "file/remove-tags",
"data": {}
}
slot
, type: string, required EmbedSpace storage slot name (username).file
, type: string, required Specifies the file which you intend to rename. You specify the values in mentioned formats.new_name
, type: string, required New name of the file. File name does not contain / * ? " ' : < > | & #{
"slot": "myslot",
"file": "f:af08245bfe0f9b6",
"new_name": "New File Name.txt"
}
{
"status": 200,
"response": "OK",
"request": "file/rename",
"data": {
"last_modified": 154789236,
"modified_by": 457516645
}
}
last_modified
, type: integer The Unix timestamp of when the user deleted the version.modified_by
, type: string The account ID of the modifier.slot
, type: string, required EmbedSpace storage slot name (username).files
, type: array, required Specifies the source file(s) to be moved. You specify the values in mentioned formats.move_to
, type: string, required Path in the user's slot that is the destination.create_folder
, type: boolean, default: true Create new folder or folders if the destination does not exists. If it is false return error.{
"slot": "myslot",
"files": [
"d:e8fc19d1153eb4/Images/Animated/Copy of sample1.png",
"d:e8fc19d1153eb4/Images/Films/sample.jpg",
"d:1a131c5a888c9/Copy of sample2.png",
"2008/Images/Animated/Copy of Untitled22.jpg",
"f:2a131c5a888c3"
],
"move_to": "2008/Images/Destination/",
"create_folder": true
}
{
"status": 200,
"response": "OK",
"request": "file/move-files",
"data": {
"moved": 3,
"failed": 0
}
}
moved
, type: integer Number of files moved successfully.failed
, type: integer Number of files failed the operation.slot
, type: string, required EmbedSpace storage slot name (username).file
, type: string, required The path of a file on EmbedSpace. You specify the values in mentioned formats.{
"slot": "myslot",
"file": "f:af08245bfe0f9b6"
}
{
"status": 200,
"response": "OK",
"request": "file/get-details",
"data": {
"details": {
"id": "af08245bfe0f9b6",
"name": "New Open.docx",
"created_at": 1614523732,
"created_by": {
"account_id": "548412522",
"display_name": "Peter John"
},
"last_modified": 1616082295,
"last_modified_by": {
"account_id": "548412522",
"display_name": "Peter John"
},
"versions": 1,
"storage_used": 1336461,
"size": 1336461,
"type": "binary/octet-stream",
"owner": {
"account_id": "478412522",
"display_name": "Sony Singh"
},
"slot": "alameenlr",
"parent_folder": {
"id": "df08245bfe0f8f7",
"name": "Building_5"
},
"location": "Site/Images/Building_5/"
}
}
}
details
, File details Details of requested file.id
, type: string A unique identifier for the file.name
, type: string Name of the file.created_at
, type: integer The Unix timestamp, when the user deleted the version.created_by
, User Info Which user created the file.account_id
, type: string The account ID of the user.display_name
, type: string The display name of the user.last_modified
, type: integer The Unix timestamp indicating when the user modified the file.last_modified_by
, User Info User info who is modified the file last.account_id
, type: string The account ID of the user.display_name
, type: string The display name of the user.versions
, type: integer How many versions of the file still active.storage_used
, type: integer The total file size(sum of all version) in bytes.size
, type: integer The file size(current version) in bytes.type
, type: string A standard MIME type describing the format of the file data.owner
, User Info File owner information.account_id
, type: string The account ID of the user.display_name
, type: string The display name of the user.slot
, type: string Which EmbedSpace storage slot holds the file.parent_folder
, Parent folder info Folder information.id
, type: string A unique identifier for the folder.name
, type: string Name of the folder.path
, type: string Path to the file realated to slot.slot
, type: string, required EmbedSpace storage slot name (username).path
, type: string, Where the folder to be created, in the user's storage slot.new_folder
, type: string, required Name of new folder. Folder name does not contain / * ? " ' : < > | & #{
"slot": "myslot",
"path":"2008/Images/Animated/",
"new_folder": "New Folder"
}
{
"status": 200,
"response": "OK",
"request": "file/create-folder",
"data": {
"folder": {
"name": "New Folder",
"id": "a4d24cde7b2a9",
"created_at": 1616264311
}
}
}
folder
,New folder info Details about newly created folder.id
, type: string A unique identifier for the folder.name
, type: string Name of the folder.created_at
, type: integer The Unix timestamp, when the user created the folder.slot
, type: string, required EmbedSpace storage slot name (username).path
, type: string, Where the folder to be created, in the user's storage slot.only_folders
, type: boolean, default: false, List folders only.only_files
, type: boolean, default: false, List files only.sort
, Sort by, Sort the List. By default sorted by File/Folder Name in ascending order.by
, type: string Items are always sorted by their name first, with folders listed before files. Value is one of name, last_modified, created_at, sizedirection
, type: string The direction to sort results in. This can be either in alphabetical ascending ASC or descending DESC order.start_from
, type: integer, default: 0 Where you want to start listing from. EmbedSpace begins listing after this defined value, in ascending order of name. If it's 0, start at the beginning of the list.max_results
, type: integer, default: 100, max: 100 Sets the maximum number of items in the response that will be returned. The action returns up to 100 key names by default.{
"slot": "myslot",
"path":"2008/Images/Animated/",
"only_folders": false,
"only_files": false,
"sort":{
"by":"name",
"direction": "ASC"
},
"start_from": 30,
"max_results": 50
}
{
"status": 200,
"response": "OK",
"request": "folder/list-items",
"data": {
"folders": [
{
"name": "New Folder",
"id": "a40bff82ee32f",
"created_at": 1616264311,
"created_by": "4516264313",
"last_modified_at": "4516264313",
"last_modified_by": 1616264311,
},
{
"name": "New Folder2",
"id": "2a9903fc9d70b",
...
},
...
],
"files": [
{
"name": "sample1.jpg",
"id": "fc9d70bff8e32f",
"created_at": 1616264311,
"created_by": "4516264313",
"last_modified_at": "4516264313",
"last_modified_by": 1616264311,
"size": 46454311,
"versions": 142
},
{
"name": "sample2.jpg",
"id": "GTf4eDYwNTYzYzc3",
...
},
...
]
}
}
folders
, folder infotype: array Details about folders.name
, type: string Name of the folder.id
, type: string A unique identifier for the folder.created_at
, type: integer The Unix timestamp, when the user created the folder.created_by
, type: string The account ID of the user, who created the file.last_modified_at
, type: integer The Unix timestamp, when the user modified the folder.last_modified_by
, type: string The account ID of the user, who created the file.files
, file infotype: array Details about files.name
, type: string Name of the folder.id
, type: string A unique identifier for the folder.created_at
, type: integer The Unix timestamp, when the user created the folder.created_by
, type: string The account ID of the user, who created the file.last_modified_at
, type: integer The Unix timestamp, when the user modified the folder.last_modified_by
, type: string The account ID of the user, who created the file.size
, type: integer The file size(current version) in bytes.versions
, type: integer How many versions of the file still active.slot
, type: string, required EmbedSpace storage slot name (username).folders
, type: array, required Specifies the folder(s) for set public-access permission. You specify the values in mentioned formats.public_access
, type: boolean, required setting public-access permission of folder(s).{
"slot": "myslot",
"folders": [
"d:e8fc19d1153eb4/Images/Animated/",
"d:e8fc19d1153eb4/Images/Films/",
"d:1a131c5a888c9"
],
"public_access": true
}
{
"status": 200,
"response": "OK",
"request": "folder/public-access",
"data": {}
}
slot
, type: string, required EmbedSpace storage slot name (username).folders
, type: array, required Specifies the folder(s) for delete. You specify the values in mentioned formats.permanent
, type: boolean, required If it is true folder(s) will be deleted permanently, else go to trash.{
"slot": "myslot",
"folders": [
"d:e8fc19d1153eb4/Images/Animated/",
"d:e8fc19d1153eb4/Images/Films/",
"f:2a131c5a888c3"
],
"permanent": true
}
{
"status": 200,
"response": "OK",
"request": "folder/delete",
"data": {
"deleted_at": 45426889
}
}
slot
, type: string, required EmbedSpace storage slot name (username).folder
, type: string, required Specifies the folder which you intend to rename. You specify the values in mentioned formats.new_name
, type: string, required New name of the folder. file name does not contain / * ? " ' : < > | & #{
"slot": "myslot",
"file": "d:ff0824345e0f9b6",
"new_name": "New Folder Name"
}
{
"status": 200,
"response": "OK",
"request": "folder/rename",
"data": {
"last_modified": 154789236,
"modified_by": 457516645
}
}
last_modified
, type: integer The Unix timestamp of when the user deleted the version.modified_by
, type: string The account ID of the modifier.slot
, type: string, required EmbedSpace storage slot name (username).folders
, type: array, required Specifies the source folders(s) to be moved. You specify the values in mentioned formats.move_to
, type: string, required Path in the user's slot that is the destination.create_folder
, type: boolean, default: true Create new folder or folders if the destination does not exists. If it is false return error.{
"slot": "myslot",
"folders": [
"d:e8fc19d1153eb4/Images/Animated/",
"d:e8fc19d1153eb4/Images/Films/",
"d:1a131c5a888c9"
],
"move_to": "2008/Images/Destination/",
"create_folder": true
}
{
"status": 200,
"response": "OK",
"request": "folder/move-folders",
"data": {
"moved": 3,
"failed": 0
}
}
moved
, type: integer Number of folders moved successfully.failed
, type: integer Number of folders failed the operation.slot
, type: string, required EmbedSpace storage slot name (username).folder
, type: string, requiredThe path of a folder on EmbedSpace. You specify the values in mentioned formats.{
"slot": "myslot",
"folder": "d:af08245bfe0f9b6/Images/Net/"
}
{
"status": 200,
"response": "OK",
"request": "folder/get-details",
"data": {
"details": {
"id": "af08245bfe0f9b6",
"name": "March",
"created_at": 1614523732,
"created_by": {
"account_id": "3",
"display_name": "Al Ameen"
},
"contains": {
"folders": 5,
"files": 124
},
"last_modified": 1616082295,
"last_modified_by": {
"account_id": "3",
"display_name": "Al Ameen"
},
"storage_used": 1336461,
"size": 1336461,
"owner": {
"account_id": "3",
"display_name": "Al Ameen"
},
"slot": "alameenlr",
"parent_folder": {
"id": "2f08245bfe0f8b6",
"name": "2020"
},
"location": "Reports/Financial/2020/"
}
}
}
details
, Folder details Details of requested folder.id
, type: string A unique identifier for the file.name
, type: string Name of the file.created_at
, type: integer The Unix timestamp, when the user deleted the version.created_by
, User Info Which user created the file.account_id
, type: string The account ID of the user.display_name
, type: string The display name of the user.items_count
, Items count Number of items inside a folder.folders
, type: integer Count folders and its subfolders in requested folder.files
, type: integer Count the files in the requested folder and its subfolders.last_modified
, type: integer The Unix timestamp indicating when the user modified the file.last_modified_by
, User Info User info who is modified the file last.account_id
, type: string The account ID of the user.display_name
, type: string The display name of the user.storage_used
, type: integer The total file size(sum of all version) in bytes.size
, type: integer The file size(current version) in bytes.type
, type: string A standard MIME type describing the format of the file data.owner
, User Info File owner information.account_id
, type: string The account ID of the user.display_name
, type: string The display name of the user.slot
, type: string Which EmbedSpace storage slot holds the file.parent_folder
, Parent folder info Folder information.id
, type: string A unique identifier for the folder.name
, type: string Name of the folder.path
, type: string Path to the file realated to slot.