cURL
curl --request POST \
--url https://api.invopop.com/silo/v1/entries/{entry_id}/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "invoice.pdf",
"category": "format",
"data": "aSDinaTvuI8gbWludGxpZnk=",
"desc": "Invoice for January 2021.",
"embeddable": true,
"key": "pdf",
"meta": {},
"mime": "application/pdf",
"private": true,
"sha256": "27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28",
"size": 12345
}
'import requests
url = "https://api.invopop.com/silo/v1/entries/{entry_id}/files"
payload = {
"name": "invoice.pdf",
"category": "format",
"data": "aSDinaTvuI8gbWludGxpZnk=",
"desc": "Invoice for January 2021.",
"embeddable": True,
"key": "pdf",
"meta": {},
"mime": "application/pdf",
"private": True,
"sha256": "27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28",
"size": 12345
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'invoice.pdf',
category: 'format',
data: 'aSDinaTvuI8gbWludGxpZnk=',
desc: 'Invoice for January 2021.',
embeddable: true,
key: 'pdf',
meta: {},
mime: 'application/pdf',
private: true,
sha256: '27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28',
size: 12345
})
};
fetch('https://api.invopop.com/silo/v1/entries/{entry_id}/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://api.invopop.com/silo/v1/entries/{entry_id}/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 => json_encode([
'name' => 'invoice.pdf',
'category' => 'format',
'data' => 'aSDinaTvuI8gbWludGxpZnk=',
'desc' => 'Invoice for January 2021.',
'embeddable' => true,
'key' => 'pdf',
'meta' => [
],
'mime' => 'application/pdf',
'private' => true,
'sha256' => '27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28',
'size' => 12345
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.invopop.com/silo/v1/entries/{entry_id}/files"
payload := strings.NewReader("{\n \"name\": \"invoice.pdf\",\n \"category\": \"format\",\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"desc\": \"Invoice for January 2021.\",\n \"embeddable\": true,\n \"key\": \"pdf\",\n \"meta\": {},\n \"mime\": \"application/pdf\",\n \"private\": true,\n \"sha256\": \"27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28\",\n \"size\": 12345\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.invopop.com/silo/v1/entries/{entry_id}/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"invoice.pdf\",\n \"category\": \"format\",\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"desc\": \"Invoice for January 2021.\",\n \"embeddable\": true,\n \"key\": \"pdf\",\n \"meta\": {},\n \"mime\": \"application/pdf\",\n \"private\": true,\n \"sha256\": \"27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28\",\n \"size\": 12345\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/silo/v1/entries/{entry_id}/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"invoice.pdf\",\n \"category\": \"format\",\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"desc\": \"Invoice for January 2021.\",\n \"embeddable\": true,\n \"key\": \"pdf\",\n \"meta\": {},\n \"mime\": \"application/pdf\",\n \"private\": true,\n \"sha256\": \"27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28\",\n \"size\": 12345\n}"
response = http.request(request)
puts response.read_body{
"category": "version",
"created_at": "2018-01-01T00:00:00.000Z",
"desc": "Invoice for January 2021.",
"embeddable": true,
"entry_id": "347c5b04-cde2-11ed-afa1-0242ac120002",
"hash": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6",
"id": "<string>",
"key": "pdf",
"meta": {},
"mime": "application/pdf",
"name": "invoice.pdf",
"previous": [
{
"created_at": "2018-01-01T00:00:00.000Z",
"hash": "<string>",
"id": "<string>",
"size": 123
}
],
"private": true,
"size": 12345,
"stored": true,
"url": "<string>"
}Entries
Create a file without UUID
Add a new file to a silo entry without an explicit UUID. The file data can be provided inline as base64 encoded data, or omitted to create a placeholder. When data is not provided, you must provide sha256, size, and mime fields, and the response will include a url field that can be used to stream/upload the file contents directly via a PUT request to that URL. For non-enrolled users, only the format and attachment categories are allowed.
POST
/
silo
/
v1
/
entries
/
{entry_id}
/
files
cURL
curl --request POST \
--url https://api.invopop.com/silo/v1/entries/{entry_id}/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "invoice.pdf",
"category": "format",
"data": "aSDinaTvuI8gbWludGxpZnk=",
"desc": "Invoice for January 2021.",
"embeddable": true,
"key": "pdf",
"meta": {},
"mime": "application/pdf",
"private": true,
"sha256": "27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28",
"size": 12345
}
'import requests
url = "https://api.invopop.com/silo/v1/entries/{entry_id}/files"
payload = {
"name": "invoice.pdf",
"category": "format",
"data": "aSDinaTvuI8gbWludGxpZnk=",
"desc": "Invoice for January 2021.",
"embeddable": True,
"key": "pdf",
"meta": {},
"mime": "application/pdf",
"private": True,
"sha256": "27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28",
"size": 12345
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'invoice.pdf',
category: 'format',
data: 'aSDinaTvuI8gbWludGxpZnk=',
desc: 'Invoice for January 2021.',
embeddable: true,
key: 'pdf',
meta: {},
mime: 'application/pdf',
private: true,
sha256: '27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28',
size: 12345
})
};
fetch('https://api.invopop.com/silo/v1/entries/{entry_id}/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://api.invopop.com/silo/v1/entries/{entry_id}/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 => json_encode([
'name' => 'invoice.pdf',
'category' => 'format',
'data' => 'aSDinaTvuI8gbWludGxpZnk=',
'desc' => 'Invoice for January 2021.',
'embeddable' => true,
'key' => 'pdf',
'meta' => [
],
'mime' => 'application/pdf',
'private' => true,
'sha256' => '27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28',
'size' => 12345
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.invopop.com/silo/v1/entries/{entry_id}/files"
payload := strings.NewReader("{\n \"name\": \"invoice.pdf\",\n \"category\": \"format\",\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"desc\": \"Invoice for January 2021.\",\n \"embeddable\": true,\n \"key\": \"pdf\",\n \"meta\": {},\n \"mime\": \"application/pdf\",\n \"private\": true,\n \"sha256\": \"27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28\",\n \"size\": 12345\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.invopop.com/silo/v1/entries/{entry_id}/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"invoice.pdf\",\n \"category\": \"format\",\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"desc\": \"Invoice for January 2021.\",\n \"embeddable\": true,\n \"key\": \"pdf\",\n \"meta\": {},\n \"mime\": \"application/pdf\",\n \"private\": true,\n \"sha256\": \"27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28\",\n \"size\": 12345\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/silo/v1/entries/{entry_id}/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"invoice.pdf\",\n \"category\": \"format\",\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"desc\": \"Invoice for January 2021.\",\n \"embeddable\": true,\n \"key\": \"pdf\",\n \"meta\": {},\n \"mime\": \"application/pdf\",\n \"private\": true,\n \"sha256\": \"27a0b656df99dc32124b4c49f2f3c35025f0a7453f289cbaa0701435cfcf4e28\",\n \"size\": 12345\n}"
response = http.request(request)
puts response.read_body{
"category": "version",
"created_at": "2018-01-01T00:00:00.000Z",
"desc": "Invoice for January 2021.",
"embeddable": true,
"entry_id": "347c5b04-cde2-11ed-afa1-0242ac120002",
"hash": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6",
"id": "<string>",
"key": "pdf",
"meta": {},
"mime": "application/pdf",
"name": "invoice.pdf",
"previous": [
{
"created_at": "2018-01-01T00:00:00.000Z",
"hash": "<string>",
"id": "<string>",
"size": 123
}
],
"private": true,
"size": 12345,
"stored": true,
"url": "<string>"
}Authorizations
Body
application/json
Response
200 - application/json
OK
Was this page helpful?