Storages API v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Storages API for upload and download
Base URLs:
Default
post__upload
Code samples
# You can also use wget
curl -X POST https://mail.example.com/zx/powerstore/v1/upload?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1 \
-H 'Content-Type: multipart/form-data'
POST https://mail.example.com/zx/powerstore/v1/upload?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1 HTTP/1.1
Host: mail.example.com
Content-Type: multipart/form-data
const inputBody = '{
"file": "string"
}';
const headers = {
'Content-Type':'multipart/form-data'
};
fetch('https://mail.example.com/zx/powerstore/v1/upload?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"file": "string"
};
const headers = {
'Content-Type':'multipart/form-data'
};
fetch('https://mail.example.com/zx/powerstore/v1/upload?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1',
{
method: 'POST',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'multipart/form-data'
}
result = RestClient.post 'https://mail.example.com/zx/powerstore/v1/upload',
params: {
'accountId' => 'string(uuid)',
'type' => 'string',
'node' => 'string',
'version' => 'integer'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'multipart/form-data'
}
r = requests.post('https://mail.example.com/zx/powerstore/v1/upload', params={
'accountId': 'bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9', 'type': 'files', 'node': 'a3a8d5d3-f236-4d00-9ba5-91f5a70d514f', 'version': '1'
}, headers = headers)
print(r.json())
URL obj = new URL("https://mail.example.com/zx/powerstore/v1/upload?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://mail.example.com/zx/powerstore/v1/upload", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'multipart/form-data',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://mail.example.com/zx/powerstore/v1/upload', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
POST /upload
Upload a new file - doesn't allow to override an already existent file
Body parameter
file: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
accountId | query | string(uuid) | true | none |
type | query | string | true | none |
node | query | string | true | unique identifier of the uploaded file |
version | query | integer | true | the file version |
body | body | object | false | none |
» file | body | string(binary) | false | none |
Enumerated Values
Parameter | Value |
---|---|
type | files |
type | chats |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | File uploaded successfully | None |
400 | Bad Request | Invalid parameters | None |
403 | Forbidden | Access to the storage denied | None |
422 | Unprocessable Entity | The Storage is full for the provided account | None |
503 | Service Unavailable | The Storages Service is unavailable | None |
put__upload
Code samples
# You can also use wget
curl -X PUT https://mail.example.com/zx/powerstore/v1/upload?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1 \
-H 'Content-Type: multipart/form-data'
PUT https://mail.example.com/zx/powerstore/v1/upload?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1 HTTP/1.1
Host: mail.example.com
Content-Type: multipart/form-data
const inputBody = '{
"file": "string"
}';
const headers = {
'Content-Type':'multipart/form-data'
};
fetch('https://mail.example.com/zx/powerstore/v1/upload?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"file": "string"
};
const headers = {
'Content-Type':'multipart/form-data'
};
fetch('https://mail.example.com/zx/powerstore/v1/upload?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1',
{
method: 'PUT',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'multipart/form-data'
}
result = RestClient.put 'https://mail.example.com/zx/powerstore/v1/upload',
params: {
'accountId' => 'string(uuid)',
'type' => 'string',
'node' => 'string',
'version' => 'integer'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'multipart/form-data'
}
r = requests.put('https://mail.example.com/zx/powerstore/v1/upload', params={
'accountId': 'bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9', 'type': 'files', 'node': 'a3a8d5d3-f236-4d00-9ba5-91f5a70d514f', 'version': '1'
}, headers = headers)
print(r.json())
URL obj = new URL("https://mail.example.com/zx/powerstore/v1/upload?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://mail.example.com/zx/powerstore/v1/upload", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'multipart/form-data',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://mail.example.com/zx/powerstore/v1/upload', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
PUT /upload
Upload a file - allows to override an already existent file
Body parameter
file: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
accountId | query | string(uuid) | true | none |
type | query | string | true | none |
node | query | string | true | unique identifier of the uploaded file |
version | query | integer | true | the file version |
body | body | object | false | none |
» file | body | string(binary) | false | none |
Enumerated Values
Parameter | Value |
---|---|
type | files |
type | chats |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | File uploaded successfully | None |
400 | Bad Request | Invalid parameters | None |
403 | Forbidden | Access to the storage denied | None |
422 | Unprocessable Entity | The Storage is full for the provided account | None |
503 | Service Unavailable | The Storages Service is unavailable | None |
get__download
Code samples
# You can also use wget
curl -X GET https://mail.example.com/zx/powerstore/v1/download?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1 \
-H 'Accept: application/octet-stream'
GET https://mail.example.com/zx/powerstore/v1/download?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1 HTTP/1.1
Host: mail.example.com
Accept: application/octet-stream
const headers = {
'Accept':'application/octet-stream'
};
fetch('https://mail.example.com/zx/powerstore/v1/download?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/octet-stream'
};
fetch('https://mail.example.com/zx/powerstore/v1/download?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/octet-stream'
}
result = RestClient.get 'https://mail.example.com/zx/powerstore/v1/download',
params: {
'accountId' => 'string(uuid)',
'type' => 'string',
'node' => 'string',
'version' => 'integer'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/octet-stream'
}
r = requests.get('https://mail.example.com/zx/powerstore/v1/download', params={
'accountId': 'bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9', 'type': 'files', 'node': 'a3a8d5d3-f236-4d00-9ba5-91f5a70d514f', 'version': '1'
}, headers = headers)
print(r.json())
URL obj = new URL("https://mail.example.com/zx/powerstore/v1/download?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/octet-stream"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://mail.example.com/zx/powerstore/v1/download", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/octet-stream',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://mail.example.com/zx/powerstore/v1/download', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /download
Download a file
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
accountId | query | string(uuid) | true | none |
type | query | string | true | none |
node | query | string | true | unique identifier of the uploaded file |
version | query | integer | true | the file version |
Enumerated Values
Parameter | Value |
---|---|
type | files |
type | chats |
Example responses
200 Response
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | File downloaded successfully | string |
400 | Bad Request | Invalid parameters | None |
403 | Forbidden | Access to the storage denied | None |
delete__delete
Code samples
# You can also use wget
curl -X DELETE https://mail.example.com/zx/powerstore/v1/delete?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1
DELETE https://mail.example.com/zx/powerstore/v1/delete?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1 HTTP/1.1
Host: mail.example.com
fetch('https://mail.example.com/zx/powerstore/v1/delete?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
fetch('https://mail.example.com/zx/powerstore/v1/delete?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
result = RestClient.delete 'https://mail.example.com/zx/powerstore/v1/delete',
params: {
'accountId' => 'string(uuid)',
'type' => 'string',
'node' => 'string',
'version' => 'integer'
}
p JSON.parse(result)
import requests
r = requests.delete('https://mail.example.com/zx/powerstore/v1/delete', params={
'accountId': 'bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9', 'type': 'files', 'node': 'a3a8d5d3-f236-4d00-9ba5-91f5a70d514f', 'version': '1'
})
print(r.json())
URL obj = new URL("https://mail.example.com/zx/powerstore/v1/delete?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&node=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&version=1");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://mail.example.com/zx/powerstore/v1/delete", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
request('DELETE','https://mail.example.com/zx/powerstore/v1/delete', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
DELETE /delete
Delete a file
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
accountId | query | string(uuid) | true | none |
type | query | string | true | none |
node | query | string | true | unique identifier of the uploaded file |
version | query | integer | true | the file version |
Enumerated Values
Parameter | Value |
---|---|
type | files |
type | chats |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | File deleted successfully | None |
400 | Bad Request | Invalid parameters | None |
403 | Forbidden | Access to the storage denied | None |
post__bulk-delete
Code samples
# You can also use wget
curl -X POST https://mail.example.com/zx/powerstore/v1/bulk-delete?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files \
-H 'Content-Type: application/json'
POST https://mail.example.com/zx/powerstore/v1/bulk-delete?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files HTTP/1.1
Host: mail.example.com
Content-Type: application/json
const inputBody = '{
"ids": [
{
"node": "string",
"version": "string"
}
]
}';
const headers = {
'Content-Type':'application/json'
};
fetch('https://mail.example.com/zx/powerstore/v1/bulk-delete?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"ids": [
{
"node": "string",
"version": "string"
}
]
};
const headers = {
'Content-Type':'application/json'
};
fetch('https://mail.example.com/zx/powerstore/v1/bulk-delete?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files',
{
method: 'POST',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json'
}
result = RestClient.post 'https://mail.example.com/zx/powerstore/v1/bulk-delete',
params: {
'accountId' => 'string(uuid)',
'type' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json'
}
r = requests.post('https://mail.example.com/zx/powerstore/v1/bulk-delete', params={
'accountId': 'bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9', 'type': 'files'
}, headers = headers)
print(r.json())
URL obj = new URL("https://mail.example.com/zx/powerstore/v1/bulk-delete?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://mail.example.com/zx/powerstore/v1/bulk-delete", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://mail.example.com/zx/powerstore/v1/bulk-delete', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
POST /bulk-delete
Delete multiple files
Body parameter
{
"ids": [
{
"node": "string",
"version": "string"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
accountId | query | string(uuid) | true | none |
type | query | string | true | none |
body | body | object | true | none |
» ids | body | [object] | false | none |
»» node | body | string | false | unique identifier of the uploaded file |
»» version | body | string | false | the file version |
Enumerated Values
Parameter | Value |
---|---|
type | files |
type | chats |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | File uploaded successfully | None |
400 | Bad Request | Invalid parameters | None |
403 | Forbidden | Access to the storage denied | None |
put__copy
Code samples
# You can also use wget
curl -X PUT https://mail.example.com/zx/powerstore/v1/copy?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&sourceNode=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&sourceVersion=1&destinationAccountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&destinationNode=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&destinationVersion=1&override=true
PUT https://mail.example.com/zx/powerstore/v1/copy?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&sourceNode=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&sourceVersion=1&destinationAccountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&destinationNode=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&destinationVersion=1&override=true HTTP/1.1
Host: mail.example.com
fetch('https://mail.example.com/zx/powerstore/v1/copy?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&sourceNode=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&sourceVersion=1&destinationAccountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&destinationNode=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&destinationVersion=1&override=true',
{
method: 'PUT'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
fetch('https://mail.example.com/zx/powerstore/v1/copy?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&sourceNode=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&sourceVersion=1&destinationAccountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&destinationNode=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&destinationVersion=1&override=true',
{
method: 'PUT'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
result = RestClient.put 'https://mail.example.com/zx/powerstore/v1/copy',
params: {
'accountId' => 'string(uuid)',
'type' => 'string',
'sourceNode' => 'string',
'sourceVersion' => 'integer',
'destinationAccountId' => 'string(uuid)',
'destinationNode' => 'string',
'destinationVersion' => 'integer',
'override' => 'boolean'
}
p JSON.parse(result)
import requests
r = requests.put('https://mail.example.com/zx/powerstore/v1/copy', params={
'accountId': 'bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9', 'type': 'files', 'sourceNode': 'a3a8d5d3-f236-4d00-9ba5-91f5a70d514f', 'sourceVersion': '1', 'destinationAccountId': 'bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9', 'destinationNode': 'a3a8d5d3-f236-4d00-9ba5-91f5a70d514f', 'destinationVersion': '1', 'override': 'true'
})
print(r.json())
URL obj = new URL("https://mail.example.com/zx/powerstore/v1/copy?accountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&type=files&sourceNode=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&sourceVersion=1&destinationAccountId=bf6f895e-a8a7-462b-9aaa-ae50e4a9cbd9&destinationNode=a3a8d5d3-f236-4d00-9ba5-91f5a70d514f&destinationVersion=1&override=true");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://mail.example.com/zx/powerstore/v1/copy", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
request('PUT','https://mail.example.com/zx/powerstore/v1/copy', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
PUT /copy
Copy a file
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
accountId | query | string(uuid) | true | account identifier of the source file |
type | query | string | true | none |
sourceNode | query | string | true | unique identifier of the source file |
sourceVersion | query | integer | true | the source file version |
destinationAccountId | query | string(uuid) | true | account identifier of the destination file |
destinationNode | query | string | true | unique identifier of the destination file |
destinationVersion | query | integer | true | the destination file version |
override | query | boolean | true | if true, the destination file will be overridden |
Enumerated Values
Parameter | Value |
---|---|
type | files |
type | chats |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | File uploaded successfully | None |
400 | Bad Request | Invalid parameters | None |
403 | Forbidden | Access to the storage denied | None |
422 | Unprocessable Entity | The Storage is full for the provided account | None |
503 | Service Unavailable | The Storages Service is unavailable | None |