curl --request POST \
--url https://api.pivocloud.com/api/v1/dbs/{id}/export \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pivocloud.com/api/v1/dbs/{id}/export"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pivocloud.com/api/v1/dbs/{id}/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pivocloud.com/api/v1/dbs/{id}/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pivocloud.com/api/v1/dbs/{id}/export"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pivocloud.com/api/v1/dbs/{id}/export")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pivocloud.com/api/v1/dbs/{id}/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"success": true,
"error": "<string>",
"code": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>"
}Start a database export
Starts a fresh export of one of your databases and returns a signed download URL straight away.
The export itself runs after this request returns, so the link is not ready at the moment you receive it: it answers 503 while the export is still being prepared, then serves the archive once it finishes. A script can therefore request an export and poll that one link, without asking for a status anywhere else. See the download endpoint for the request that does this safely.
curl --request POST \
--url https://api.pivocloud.com/api/v1/dbs/{id}/export \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pivocloud.com/api/v1/dbs/{id}/export"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pivocloud.com/api/v1/dbs/{id}/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pivocloud.com/api/v1/dbs/{id}/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pivocloud.com/api/v1/dbs/{id}/export"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pivocloud.com/api/v1/dbs/{id}/export")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pivocloud.com/api/v1/dbs/{id}/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"success": true,
"error": "<string>",
"code": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>"
}Authorizations
A personal access token. Create one in the API tokens section of your profile page in the PivoCloud console. The token is shown once, when you create it.
Path Parameters
The identifier of the database to export.
Response
The export was accepted, and the response carries the download URL for it.
The reply to an export request. Both fields are always present.
The download link for this export, complete with its signature and expiry. Store it as it is and request it as it is.
The moment the download link stops working. Links are short-lived, minutes rather than days, so read this value rather than taking a horizon from any example you have seen. A link requested after this moment answers 401 with the code SIGNED_URL_EXPIRED, which is the link having lapsed rather than anything wrong with the request.