English
English
Appearance
English
English
Appearance
https://api.repliz.com/public/storage/file/folderMove files into a folder, or out of their folder. The file URLs stay the same, so posts that already use the files keep working.
Authorization: Basic Base64(AccessKey:SecretKey)) or Bearer token from Login with Replizstorage:write| Field | Type | Required | Description |
|---|---|---|---|
fileIds | array | Yes | IDs of the files to move, from 1 to 100. |
folderId | string | null | No | Folder to move the files into, the _id from Get Folder. Send null or leave it out to take the files out of their folder. |
curl -X PUT "https://api.repliz.com/public/storage/file/folder" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{
"fileIds": ["680affa5ce12f2f72916f67e", "680affa5ce12f2f72916f67a"],
"folderId": "6a4c3b580afd72bb342c3886"
}'import axios from 'axios';
const response = await axios.put(
'https://api.repliz.com/public/storage/file/folder',
{
fileIds: ['680affa5ce12f2f72916f67e', '680affa5ce12f2f72916f67a'],
folderId: '6a4c3b580afd72bb342c3886',
},
{
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY',
},
},
);
console.log(response.status);const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const response = await fetch('https://api.repliz.com/public/storage/file/folder', {
method: 'PUT',
headers: {
Authorization: `Basic ${credentials}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
fileIds: ['680affa5ce12f2f72916f67e', '680affa5ce12f2f72916f67a'],
folderId: '6a4c3b580afd72bb342c3886',
}),
});
console.log(response.status);// No content returned on success{
"code": 404,
"message": "folder not found"
}{
"code": 401,
"message": "unauthorized"
}404 file not found means none of the fileIds belong to your storage.