Upload
curl --request POST \
--url https://api.example.com/api/document/resource-documents.upload \
--header 'Content-Type: application/json' \
--data '
{
"files": [
"(binary)"
],
"folder_id": "872815618512410358",
"resource_id": "872815618512410358",
"name": "<string>",
"visible": true,
"send_notification": true
}
'import requests
url = "https://api.example.com/api/document/resource-documents.upload"
payload = {
"files": ["(binary)"],
"folder_id": "872815618512410358",
"resource_id": "872815618512410358",
"name": "<string>",
"visible": True,
"send_notification": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
files: ['(binary)'],
folder_id: '872815618512410358',
resource_id: '872815618512410358',
name: '<string>',
visible: true,
send_notification: true
})
};
fetch('https://api.example.com/api/document/resource-documents.upload', 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.example.com/api/document/resource-documents.upload",
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([
'files' => [
'(binary)'
],
'folder_id' => '872815618512410358',
'resource_id' => '872815618512410358',
'name' => '<string>',
'visible' => true,
'send_notification' => true
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/document/resource-documents.upload"
payload := strings.NewReader("{\n \"files\": [\n \"(binary)\"\n ],\n \"folder_id\": \"872815618512410358\",\n \"resource_id\": \"872815618512410358\",\n \"name\": \"<string>\",\n \"visible\": true,\n \"send_notification\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/document/resource-documents.upload")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n \"(binary)\"\n ],\n \"folder_id\": \"872815618512410358\",\n \"resource_id\": \"872815618512410358\",\n \"name\": \"<string>\",\n \"visible\": true,\n \"send_notification\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/document/resource-documents.upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n \"(binary)\"\n ],\n \"folder_id\": \"872815618512410358\",\n \"resource_id\": \"872815618512410358\",\n \"name\": \"<string>\",\n \"visible\": true,\n \"send_notification\": true\n}"
response = http.request(request)
puts response.read_body{
"ids": [
"872815618512410358"
]
}Resource documents
Upload
Adds documents for a collaborator to a folder of the employee documents: all of them, or none when one is refused. The request is a multipart one, carrying up to 20 files (files[]), each within the maximum size of the instance, the whole within the 20 MB the web server accepts.
POST
/
api
/
document
/
resource-documents.upload
Upload
curl --request POST \
--url https://api.example.com/api/document/resource-documents.upload \
--header 'Content-Type: application/json' \
--data '
{
"files": [
"(binary)"
],
"folder_id": "872815618512410358",
"resource_id": "872815618512410358",
"name": "<string>",
"visible": true,
"send_notification": true
}
'import requests
url = "https://api.example.com/api/document/resource-documents.upload"
payload = {
"files": ["(binary)"],
"folder_id": "872815618512410358",
"resource_id": "872815618512410358",
"name": "<string>",
"visible": True,
"send_notification": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
files: ['(binary)'],
folder_id: '872815618512410358',
resource_id: '872815618512410358',
name: '<string>',
visible: true,
send_notification: true
})
};
fetch('https://api.example.com/api/document/resource-documents.upload', 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.example.com/api/document/resource-documents.upload",
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([
'files' => [
'(binary)'
],
'folder_id' => '872815618512410358',
'resource_id' => '872815618512410358',
'name' => '<string>',
'visible' => true,
'send_notification' => true
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/document/resource-documents.upload"
payload := strings.NewReader("{\n \"files\": [\n \"(binary)\"\n ],\n \"folder_id\": \"872815618512410358\",\n \"resource_id\": \"872815618512410358\",\n \"name\": \"<string>\",\n \"visible\": true,\n \"send_notification\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/document/resource-documents.upload")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n \"(binary)\"\n ],\n \"folder_id\": \"872815618512410358\",\n \"resource_id\": \"872815618512410358\",\n \"name\": \"<string>\",\n \"visible\": true,\n \"send_notification\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/document/resource-documents.upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n \"(binary)\"\n ],\n \"folder_id\": \"872815618512410358\",\n \"resource_id\": \"872815618512410358\",\n \"name\": \"<string>\",\n \"visible\": true,\n \"send_notification\": true\n}"
response = http.request(request)
puts response.read_body{
"ids": [
"872815618512410358"
]
}This endpoint is in preview: it may change without notice until it becomes part of a stable version.
Body
application/json