Submissions
Create a public document link
Mints a signed link that downloads this document without an API token. Anyone holding the link can open it until it expires, the account turns links off, or an admin revokes all links. Requires public document links to be on for the account.
POST
/
api
/
submissions
/
{submission_id}
/
documents
/
{id}
/
link
Create a public document link
curl --request POST \
--url https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"expires_in_days": 1825
}
'import requests
url = "https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link"
payload = { "expires_in_days": 1825 }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({expires_in_days: 1825})
};
fetch('https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link', 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://spitshake.io/api/submissions/{submission_id}/documents/{id}/link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expires_in_days' => 1825
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link"
payload := strings.NewReader("{\n \"expires_in_days\": 1825\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expires_in_days\": 1825\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires_in_days\": 1825\n}"
response = http.request(request)
puts response.read_body{
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}Authorizations
ApiTokenSessionCookie
API token generated at Settings > API
Body
application/json
Days until the link expires. Omit to use the account setting; null for a link that never expires.
Required range:
1 <= x <= 3650⌘I
Create a public document link
curl --request POST \
--url https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"expires_in_days": 1825
}
'import requests
url = "https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link"
payload = { "expires_in_days": 1825 }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({expires_in_days: 1825})
};
fetch('https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link', 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://spitshake.io/api/submissions/{submission_id}/documents/{id}/link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expires_in_days' => 1825
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link"
payload := strings.NewReader("{\n \"expires_in_days\": 1825\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expires_in_days\": 1825\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/submissions/{submission_id}/documents/{id}/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires_in_days\": 1825\n}"
response = http.request(request)
puts response.read_body{
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
