curl --request POST \
--url https://api.smokeball.com/matters/{matterId}/documents/files/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json-patch+json' \
--header 'x-api-key: <api-key>' \
--data '
[
{
"fileName": "court filing.pdf",
"folderId": "b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2",
"userId": "750eb5c5-ac0b-7d11-4997-e0ce9d8896c8",
"folderPath": "Court Filings/2023/January",
"fileAdditionalData": {
"Author": "Jane Smith",
"Pages": 12,
"Signed": true
},
"dateCreated": "2023-04-23T14:00:00Z",
"dateModified": "2023-04-24T14:00:00Z"
}
]
'import requests
url = "https://api.smokeball.com/matters/{matterId}/documents/files/bulk"
payload = [
{
"fileName": "court filing.pdf",
"folderId": "b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2",
"userId": "750eb5c5-ac0b-7d11-4997-e0ce9d8896c8",
"folderPath": "Court Filings/2023/January",
"fileAdditionalData": {
"Author": "Jane Smith",
"Pages": 12,
"Signed": True
},
"dateCreated": "2023-04-23T14:00:00Z",
"dateModified": "2023-04-24T14:00:00Z"
}
]
headers = {
"x-api-key": "<api-key>",
"Authorization": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
Authorization: '<api-key>',
'Content-Type': 'application/json-patch+json'
},
body: JSON.stringify([
{
fileName: 'court filing.pdf',
folderId: 'b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2',
userId: '750eb5c5-ac0b-7d11-4997-e0ce9d8896c8',
folderPath: 'Court Filings/2023/January',
fileAdditionalData: {Author: 'Jane Smith', Pages: 12, Signed: true},
dateCreated: '2023-04-23T14:00:00Z',
dateModified: '2023-04-24T14:00:00Z'
}
])
};
fetch('https://api.smokeball.com/matters/{matterId}/documents/files/bulk', 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.smokeball.com/matters/{matterId}/documents/files/bulk",
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([
[
'fileName' => 'court filing.pdf',
'folderId' => 'b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2',
'userId' => '750eb5c5-ac0b-7d11-4997-e0ce9d8896c8',
'folderPath' => 'Court Filings/2023/January',
'fileAdditionalData' => [
'Author' => 'Jane Smith',
'Pages' => 12,
'Signed' => true
],
'dateCreated' => '2023-04-23T14:00:00Z',
'dateModified' => '2023-04-24T14:00:00Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json-patch+json",
"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://api.smokeball.com/matters/{matterId}/documents/files/bulk"
payload := strings.NewReader("[\n {\n \"fileName\": \"court filing.pdf\",\n \"folderId\": \"b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2\",\n \"userId\": \"750eb5c5-ac0b-7d11-4997-e0ce9d8896c8\",\n \"folderPath\": \"Court Filings/2023/January\",\n \"fileAdditionalData\": {\n \"Author\": \"Jane Smith\",\n \"Pages\": 12,\n \"Signed\": true\n },\n \"dateCreated\": \"2023-04-23T14:00:00Z\",\n \"dateModified\": \"2023-04-24T14:00:00Z\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+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.smokeball.com/matters/{matterId}/documents/files/bulk")
.header("x-api-key", "<api-key>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("[\n {\n \"fileName\": \"court filing.pdf\",\n \"folderId\": \"b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2\",\n \"userId\": \"750eb5c5-ac0b-7d11-4997-e0ce9d8896c8\",\n \"folderPath\": \"Court Filings/2023/January\",\n \"fileAdditionalData\": {\n \"Author\": \"Jane Smith\",\n \"Pages\": 12,\n \"Signed\": true\n },\n \"dateCreated\": \"2023-04-23T14:00:00Z\",\n \"dateModified\": \"2023-04-24T14:00:00Z\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smokeball.com/matters/{matterId}/documents/files/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "[\n {\n \"fileName\": \"court filing.pdf\",\n \"folderId\": \"b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2\",\n \"userId\": \"750eb5c5-ac0b-7d11-4997-e0ce9d8896c8\",\n \"folderPath\": \"Court Filings/2023/January\",\n \"fileAdditionalData\": {\n \"Author\": \"Jane Smith\",\n \"Pages\": 12,\n \"Signed\": true\n },\n \"dateCreated\": \"2023-04-23T14:00:00Z\",\n \"dateModified\": \"2023-04-24T14:00:00Z\"\n }\n]"
response = http.request(request)
puts response.read_body[
{
"fileId": "b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2",
"uploadUrl": "https://example-bucket.s3.amazonaws.com/apiuploads/2f1c9a3e-6b1d-4c7e-9a0f-1d2e3f4a5b6c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&X-Amz-Signature=...",
"expiry": "2022-04-23T14:30:00Z"
}
]"<string>"Add files to a matter
Registers a batch of new files on the matter and returns one ‘UploadFileInfo’ (presigned PUT URL, valid for 1 hour) per file, in request order. Intended for data migrations. The same rules as ‘AddFile’ apply to each item.
The operation is not atomic: items are validated in order and a 400 on item n leaves the upload requests for items before it in place. No ‘Location’ header is returned. There is no cap on the array size.
curl --request POST \
--url https://api.smokeball.com/matters/{matterId}/documents/files/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json-patch+json' \
--header 'x-api-key: <api-key>' \
--data '
[
{
"fileName": "court filing.pdf",
"folderId": "b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2",
"userId": "750eb5c5-ac0b-7d11-4997-e0ce9d8896c8",
"folderPath": "Court Filings/2023/January",
"fileAdditionalData": {
"Author": "Jane Smith",
"Pages": 12,
"Signed": true
},
"dateCreated": "2023-04-23T14:00:00Z",
"dateModified": "2023-04-24T14:00:00Z"
}
]
'import requests
url = "https://api.smokeball.com/matters/{matterId}/documents/files/bulk"
payload = [
{
"fileName": "court filing.pdf",
"folderId": "b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2",
"userId": "750eb5c5-ac0b-7d11-4997-e0ce9d8896c8",
"folderPath": "Court Filings/2023/January",
"fileAdditionalData": {
"Author": "Jane Smith",
"Pages": 12,
"Signed": True
},
"dateCreated": "2023-04-23T14:00:00Z",
"dateModified": "2023-04-24T14:00:00Z"
}
]
headers = {
"x-api-key": "<api-key>",
"Authorization": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
Authorization: '<api-key>',
'Content-Type': 'application/json-patch+json'
},
body: JSON.stringify([
{
fileName: 'court filing.pdf',
folderId: 'b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2',
userId: '750eb5c5-ac0b-7d11-4997-e0ce9d8896c8',
folderPath: 'Court Filings/2023/January',
fileAdditionalData: {Author: 'Jane Smith', Pages: 12, Signed: true},
dateCreated: '2023-04-23T14:00:00Z',
dateModified: '2023-04-24T14:00:00Z'
}
])
};
fetch('https://api.smokeball.com/matters/{matterId}/documents/files/bulk', 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.smokeball.com/matters/{matterId}/documents/files/bulk",
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([
[
'fileName' => 'court filing.pdf',
'folderId' => 'b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2',
'userId' => '750eb5c5-ac0b-7d11-4997-e0ce9d8896c8',
'folderPath' => 'Court Filings/2023/January',
'fileAdditionalData' => [
'Author' => 'Jane Smith',
'Pages' => 12,
'Signed' => true
],
'dateCreated' => '2023-04-23T14:00:00Z',
'dateModified' => '2023-04-24T14:00:00Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json-patch+json",
"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://api.smokeball.com/matters/{matterId}/documents/files/bulk"
payload := strings.NewReader("[\n {\n \"fileName\": \"court filing.pdf\",\n \"folderId\": \"b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2\",\n \"userId\": \"750eb5c5-ac0b-7d11-4997-e0ce9d8896c8\",\n \"folderPath\": \"Court Filings/2023/January\",\n \"fileAdditionalData\": {\n \"Author\": \"Jane Smith\",\n \"Pages\": 12,\n \"Signed\": true\n },\n \"dateCreated\": \"2023-04-23T14:00:00Z\",\n \"dateModified\": \"2023-04-24T14:00:00Z\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+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.smokeball.com/matters/{matterId}/documents/files/bulk")
.header("x-api-key", "<api-key>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("[\n {\n \"fileName\": \"court filing.pdf\",\n \"folderId\": \"b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2\",\n \"userId\": \"750eb5c5-ac0b-7d11-4997-e0ce9d8896c8\",\n \"folderPath\": \"Court Filings/2023/January\",\n \"fileAdditionalData\": {\n \"Author\": \"Jane Smith\",\n \"Pages\": 12,\n \"Signed\": true\n },\n \"dateCreated\": \"2023-04-23T14:00:00Z\",\n \"dateModified\": \"2023-04-24T14:00:00Z\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smokeball.com/matters/{matterId}/documents/files/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "[\n {\n \"fileName\": \"court filing.pdf\",\n \"folderId\": \"b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2\",\n \"userId\": \"750eb5c5-ac0b-7d11-4997-e0ce9d8896c8\",\n \"folderPath\": \"Court Filings/2023/January\",\n \"fileAdditionalData\": {\n \"Author\": \"Jane Smith\",\n \"Pages\": 12,\n \"Signed\": true\n },\n \"dateCreated\": \"2023-04-23T14:00:00Z\",\n \"dateModified\": \"2023-04-24T14:00:00Z\"\n }\n]"
response = http.request(request)
puts response.read_body[
{
"fileId": "b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2",
"uploadUrl": "https://example-bucket.s3.amazonaws.com/apiuploads/2f1c9a3e-6b1d-4c7e-9a0f-1d2e3f4a5b6c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&X-Amz-Signature=...",
"expiry": "2022-04-23T14:30:00Z"
}
]"<string>"Body
The files to add.
Full name of the file including the file extension. Required, maximum 256 characters. The name is split on the last '.' into name and extension, and the name is normalised to XML-safe characters. It must contain at least one valid character after normalisation.
256"court filing.pdf"
Response
When request is accepted. Returns an array of 'UploadFileInfo' objects.
Temporary presigned URL to upload the file content to. Send the raw file bytes with an HTTP PUT request. The URL is valid for 1 hour from the time of the API call (see Expiry).
Important note: When uploading to this URL, set the 'Content-Type' header to an empty value.
Example cURL: curl --location --request PUT 'URL_GOES_HERE' \ --header 'Content-Type: ""' \ --data '@/C:/dir/test.pdf'
"https://example-bucket.s3.amazonaws.com/apiuploads/2f1c9a3e-6b1d-4c7e-9a0f-1d2e3f4a5b6c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&X-Amz-Signature=..."