Send file bytes to a signed Govly upload URL
curl --request POST \
--url https://app.govly.com/api/tools/v1/upload_files \
--header 'Content-Length: <content-length>' \
--header 'Content-Type: application/octet-stream' \
--header 'X-API-KEY: <api-key>' \
--data '<string>'import requests
url = "https://app.govly.com/api/tools/v1/upload_files"
payload = "<string>"
headers = {
"Content-Length": "<content-length>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Content-Length': '<content-length>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/octet-stream'
},
body: '<string>'
};
fetch('https://app.govly.com/api/tools/v1/upload_files', 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://app.govly.com/api/tools/v1/upload_files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Length: <content-length>",
"Content-Type: application/octet-stream",
"X-API-KEY: <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://app.govly.com/api/tools/v1/upload_files"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Length", "<content-length>")
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.govly.com/api/tools/v1/upload_files")
.header("Content-Length", "<content-length>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/octet-stream")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.govly.com/api/tools/v1/upload_files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Length"] = '<content-length>'
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/octet-stream'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}Workspace Attachments
Send file bytes to a signed Govly upload URL
Use the full uploadUrl and requiredHeaders returned by attach_file. The URL authorizes this upload without OAuth or an API key. Govly rechecks access, verifies size and MD5, and stores the bytes. An accepted upload cannot be overwritten; retries return 204. Then call attach_file with the same target and file type upload.
POST
/
api
/
tools
/
v1
/
upload_files
Send file bytes to a signed Govly upload URL
curl --request POST \
--url https://app.govly.com/api/tools/v1/upload_files \
--header 'Content-Length: <content-length>' \
--header 'Content-Type: application/octet-stream' \
--header 'X-API-KEY: <api-key>' \
--data '<string>'import requests
url = "https://app.govly.com/api/tools/v1/upload_files"
payload = "<string>"
headers = {
"Content-Length": "<content-length>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Content-Length': '<content-length>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/octet-stream'
},
body: '<string>'
};
fetch('https://app.govly.com/api/tools/v1/upload_files', 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://app.govly.com/api/tools/v1/upload_files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Length: <content-length>",
"Content-Type: application/octet-stream",
"X-API-KEY: <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://app.govly.com/api/tools/v1/upload_files"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Length", "<content-length>")
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.govly.com/api/tools/v1/upload_files")
.header("Content-Length", "<content-length>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/octet-stream")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.govly.com/api/tools/v1/upload_files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Length"] = '<content-length>'
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/octet-stream'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}Authorizations
Headers
Required range:
1 <= x <= 52428800Query Parameters
Expiring upload-scoped signature supplied in uploadUrl.
Body
application/octet-stream
The body is of type file.
Response
File received and stored; attach_file can now verify and attach it.
Was this page helpful?