Backup 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.
Backup API for final user operations
Base URLs:
Default
post__undelete
Code samples
# You can also use wget
curl -X POST https://mail.example.com/zx/backup/v1/undelete \
-H 'Accept: application/json'
POST https://mail.example.com/zx/backup/v1/undelete HTTP/1.1
Host: mail.example.com
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('https://mail.example.com/zx/backup/v1/undelete',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://mail.example.com/zx/backup/v1/undelete',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post 'https://mail.example.com/zx/backup/v1/undelete',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('https://mail.example.com/zx/backup/v1/undelete', headers = headers)
print(r.json())
URL obj = new URL("https://mail.example.com/zx/backup/v1/undelete");
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{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://mail.example.com/zx/backup/v1/undelete", 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/backup/v1/undelete', 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 /undelete
Undeletes account emails, getting them from the backup
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
ZX_AUTH_TOKEN | cookie | string | true | none |
start | query | string(date-time) | false | none |
end | query | string(date-time) | false | none |
Example responses
202 Response
{
"operationId": "3051932a-fdd2-48fa-b330-7e7d41535969"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | Undelete operation started | UndeleteResponse |
400 | Bad Request | Account not found | None |
403 | Forbidden | Access denied, no authentication token provided | None |
500 | Internal Server Error | Internal server error | None |
Schemas
UndeleteResponse
{
"operationId": "3051932a-fdd2-48fa-b330-7e7d41535969"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
operationId | string(uuid) | true | none | id of the operation that undeletes the emails |