curl --request PUT \
--url https://stashy.example.com/v1/files/{id}/content \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: */*' \
--data '<string>'import requests
url = "https://stashy.example.com/v1/files/{id}/content"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "*/*"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': '*/*'},
body: '<string>'
};
fetch('https://stashy.example.com/v1/files/{id}/content', 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://stashy.example.com/v1/files/{id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: */*"
],
]);
$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://stashy.example.com/v1/files/{id}/content"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "*/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://stashy.example.com/v1/files/{id}/content")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "*/*")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stashy.example.com/v1/files/{id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = '*/*'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"slug": "<string>",
"url": "<string>",
"name": "<string>",
"content_type": "<string>",
"size": "<string>",
"checksum": "<string>",
"visibility": "private",
"created_at": "2023-01-15T01:30:15.01Z",
"updated_at": "2023-01-15T01:30:15.01Z"
}Update File Content
Update a file’s content, replacing it entirely. Its ID and URL stay the same.
curl --request PUT \
--url https://stashy.example.com/v1/files/{id}/content \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: */*' \
--data '<string>'import requests
url = "https://stashy.example.com/v1/files/{id}/content"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "*/*"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': '*/*'},
body: '<string>'
};
fetch('https://stashy.example.com/v1/files/{id}/content', 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://stashy.example.com/v1/files/{id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: */*"
],
]);
$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://stashy.example.com/v1/files/{id}/content"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "*/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://stashy.example.com/v1/files/{id}/content")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "*/*")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stashy.example.com/v1/files/{id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = '*/*'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"slug": "<string>",
"url": "<string>",
"name": "<string>",
"content_type": "<string>",
"size": "<string>",
"checksum": "<string>",
"visibility": "private",
"created_at": "2023-01-15T01:30:15.01Z",
"updated_at": "2023-01-15T01:30:15.01Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The id path parameter.
^[A-Za-z0-9_-]{21}$Body
The body is of type file.
Response
Success
Unique file ID.
^[A-Za-z0-9_-]{21}$Human-readable name at the end of the URL. Empty when not set.
128^[A-Za-z0-9._~-]*$Canonical URL of the file, including the slug when set.
Original filename, e.g. "Quarterly report.pdf". Empty when not set.
255^[^/\x00-\x1F\x7F]*$Media type of the content, from the Content-Type of the upload.
Size of the content in bytes.
CRC32C checksum of the content.
^([A-Za-z0-9+/]{6}==)?$Who can open the file by its URL: "private" (only the owner), "internal" (any signed-in user), or "public" (anyone).
private, internal, public A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (Z); input may use an offset from UTC.
"2023-01-15T01:30:15.01Z"
A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (Z); input may use an offset from UTC.
"2023-01-15T01:30:15.01Z"