curl --request PUT \
--url https://web.edcontrols.com/api/v2/data/file/{database}/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"fileName": "<string>",
"size": "<string>",
"contentType": "<string>",
"fileGroupID": "<string>",
"versionId": "<string>",
"thumbnail": "<string>",
"archived": "<string>",
"project": "<string>",
"externalId": "<string>",
"tags": [
"<string>"
],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z"
},
"versions": [
{
"id": "<string>",
"fileName": "<string>",
"contentType": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"size": "<string>",
"uploadedName": "<string>",
"creator": "jsmith@example.com"
}
]
}
'import requests
url = "https://web.edcontrols.com/api/v2/data/file/{database}/{id}"
payload = {
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"fileName": "<string>",
"size": "<string>",
"contentType": "<string>",
"fileGroupID": "<string>",
"versionId": "<string>",
"thumbnail": "<string>",
"archived": "<string>",
"project": "<string>",
"externalId": "<string>",
"tags": ["<string>"],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z"
},
"versions": [
{
"id": "<string>",
"fileName": "<string>",
"contentType": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"size": "<string>",
"uploadedName": "<string>",
"creator": "jsmith@example.com"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
_id: '<string>',
_rev: '<string>',
name: '<string>',
fileName: '<string>',
size: '<string>',
contentType: '<string>',
fileGroupID: '<string>',
versionId: '<string>',
thumbnail: '<string>',
archived: '<string>',
project: '<string>',
externalId: '<string>',
tags: ['<string>'],
dates: {creationDate: '2023-11-07T05:31:56Z', lastModifiedDate: '2023-11-07T05:31:56Z'},
versions: [
{
id: '<string>',
fileName: '<string>',
contentType: '<string>',
creationDate: '2023-11-07T05:31:56Z',
size: '<string>',
uploadedName: '<string>',
creator: 'jsmith@example.com'
}
]
})
};
fetch('https://web.edcontrols.com/api/v2/data/file/{database}/{id}', 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://web.edcontrols.com/api/v2/data/file/{database}/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'_id' => '<string>',
'_rev' => '<string>',
'name' => '<string>',
'fileName' => '<string>',
'size' => '<string>',
'contentType' => '<string>',
'fileGroupID' => '<string>',
'versionId' => '<string>',
'thumbnail' => '<string>',
'archived' => '<string>',
'project' => '<string>',
'externalId' => '<string>',
'tags' => [
'<string>'
],
'dates' => [
'creationDate' => '2023-11-07T05:31:56Z',
'lastModifiedDate' => '2023-11-07T05:31:56Z'
],
'versions' => [
[
'id' => '<string>',
'fileName' => '<string>',
'contentType' => '<string>',
'creationDate' => '2023-11-07T05:31:56Z',
'size' => '<string>',
'uploadedName' => '<string>',
'creator' => 'jsmith@example.com'
]
]
]),
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://web.edcontrols.com/api/v2/data/file/{database}/{id}"
payload := strings.NewReader("{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"fileName\": \"<string>\",\n \"size\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileGroupID\": \"<string>\",\n \"versionId\": \"<string>\",\n \"thumbnail\": \"<string>\",\n \"archived\": \"<string>\",\n \"project\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\"\n },\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"size\": \"<string>\",\n \"uploadedName\": \"<string>\",\n \"creator\": \"jsmith@example.com\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://web.edcontrols.com/api/v2/data/file/{database}/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"fileName\": \"<string>\",\n \"size\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileGroupID\": \"<string>\",\n \"versionId\": \"<string>\",\n \"thumbnail\": \"<string>\",\n \"archived\": \"<string>\",\n \"project\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\"\n },\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"size\": \"<string>\",\n \"uploadedName\": \"<string>\",\n \"creator\": \"jsmith@example.com\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://web.edcontrols.com/api/v2/data/file/{database}/{id}")
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"] = 'application/json'
request.body = "{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"fileName\": \"<string>\",\n \"size\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileGroupID\": \"<string>\",\n \"versionId\": \"<string>\",\n \"thumbnail\": \"<string>\",\n \"archived\": \"<string>\",\n \"project\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\"\n },\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"size\": \"<string>\",\n \"uploadedName\": \"<string>\",\n \"creator\": \"jsmith@example.com\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "OK"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}Update a file
Updates the file, and adds a new version when fileUrl is supplied.
The body is the file document; fileName is required in it (at most
250 characters), so send the document back with your changes rather
than only the changed fields. Set versionId to an id from versions
to make that version the current one again.
Which URLs are fetched: any public https URL that works without
signing in, such as a signed link from your document system or cloud
storage. No headers are sent, credentials in the URL are refused, at most
3 redirects are followed, and private network addresses are refused. The
downloaded content must be an allowed type: PDF, JPEG, PNG, SVG, TIFF,
WebP, HEIC/HEIF, Word, Excel, PowerPoint, MP4, MOV, WMV, plain text or
STEP/IFC.
Processing is asynchronous and failures are not reported. The
answer {"code": 200, "message": "OK"} only means the request was
accepted: a refused or unreachable URL, or a content type that is not
allowed, produces no file and no error. The answer also carries no id.
Find the file afterwards by listing with searchByName.
Allowed for contract administrators, Accountable and Support.
curl --request PUT \
--url https://web.edcontrols.com/api/v2/data/file/{database}/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"fileName": "<string>",
"size": "<string>",
"contentType": "<string>",
"fileGroupID": "<string>",
"versionId": "<string>",
"thumbnail": "<string>",
"archived": "<string>",
"project": "<string>",
"externalId": "<string>",
"tags": [
"<string>"
],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z"
},
"versions": [
{
"id": "<string>",
"fileName": "<string>",
"contentType": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"size": "<string>",
"uploadedName": "<string>",
"creator": "jsmith@example.com"
}
]
}
'import requests
url = "https://web.edcontrols.com/api/v2/data/file/{database}/{id}"
payload = {
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"fileName": "<string>",
"size": "<string>",
"contentType": "<string>",
"fileGroupID": "<string>",
"versionId": "<string>",
"thumbnail": "<string>",
"archived": "<string>",
"project": "<string>",
"externalId": "<string>",
"tags": ["<string>"],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z"
},
"versions": [
{
"id": "<string>",
"fileName": "<string>",
"contentType": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"size": "<string>",
"uploadedName": "<string>",
"creator": "jsmith@example.com"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
_id: '<string>',
_rev: '<string>',
name: '<string>',
fileName: '<string>',
size: '<string>',
contentType: '<string>',
fileGroupID: '<string>',
versionId: '<string>',
thumbnail: '<string>',
archived: '<string>',
project: '<string>',
externalId: '<string>',
tags: ['<string>'],
dates: {creationDate: '2023-11-07T05:31:56Z', lastModifiedDate: '2023-11-07T05:31:56Z'},
versions: [
{
id: '<string>',
fileName: '<string>',
contentType: '<string>',
creationDate: '2023-11-07T05:31:56Z',
size: '<string>',
uploadedName: '<string>',
creator: 'jsmith@example.com'
}
]
})
};
fetch('https://web.edcontrols.com/api/v2/data/file/{database}/{id}', 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://web.edcontrols.com/api/v2/data/file/{database}/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'_id' => '<string>',
'_rev' => '<string>',
'name' => '<string>',
'fileName' => '<string>',
'size' => '<string>',
'contentType' => '<string>',
'fileGroupID' => '<string>',
'versionId' => '<string>',
'thumbnail' => '<string>',
'archived' => '<string>',
'project' => '<string>',
'externalId' => '<string>',
'tags' => [
'<string>'
],
'dates' => [
'creationDate' => '2023-11-07T05:31:56Z',
'lastModifiedDate' => '2023-11-07T05:31:56Z'
],
'versions' => [
[
'id' => '<string>',
'fileName' => '<string>',
'contentType' => '<string>',
'creationDate' => '2023-11-07T05:31:56Z',
'size' => '<string>',
'uploadedName' => '<string>',
'creator' => 'jsmith@example.com'
]
]
]),
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://web.edcontrols.com/api/v2/data/file/{database}/{id}"
payload := strings.NewReader("{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"fileName\": \"<string>\",\n \"size\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileGroupID\": \"<string>\",\n \"versionId\": \"<string>\",\n \"thumbnail\": \"<string>\",\n \"archived\": \"<string>\",\n \"project\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\"\n },\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"size\": \"<string>\",\n \"uploadedName\": \"<string>\",\n \"creator\": \"jsmith@example.com\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://web.edcontrols.com/api/v2/data/file/{database}/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"fileName\": \"<string>\",\n \"size\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileGroupID\": \"<string>\",\n \"versionId\": \"<string>\",\n \"thumbnail\": \"<string>\",\n \"archived\": \"<string>\",\n \"project\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\"\n },\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"size\": \"<string>\",\n \"uploadedName\": \"<string>\",\n \"creator\": \"jsmith@example.com\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://web.edcontrols.com/api/v2/data/file/{database}/{id}")
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"] = 'application/json'
request.body = "{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"fileName\": \"<string>\",\n \"size\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileGroupID\": \"<string>\",\n \"versionId\": \"<string>\",\n \"thumbnail\": \"<string>\",\n \"archived\": \"<string>\",\n \"project\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\"\n },\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"size\": \"<string>\",\n \"uploadedName\": \"<string>\",\n \"creator\": \"jsmith@example.com\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "OK"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}