curl --request POST \
--url https://web.edcontrols.com/api/v2/data/file/{database} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "inspection-report-week-23.pdf",
"fileGroupID": "fg-1a2b...",
"tags": [
"inspection"
]
}
'import requests
url = "https://web.edcontrols.com/api/v2/data/file/{database}"
payload = {
"fileName": "inspection-report-week-23.pdf",
"fileGroupID": "fg-1a2b...",
"tags": ["inspection"]
}
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({
fileName: 'inspection-report-week-23.pdf',
fileGroupID: 'fg-1a2b...',
tags: ['inspection']
})
};
fetch('https://web.edcontrols.com/api/v2/data/file/{database}', 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}",
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' => 'inspection-report-week-23.pdf',
'fileGroupID' => 'fg-1a2b...',
'tags' => [
'inspection'
]
]),
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}"
payload := strings.NewReader("{\n \"fileName\": \"inspection-report-week-23.pdf\",\n \"fileGroupID\": \"fg-1a2b...\",\n \"tags\": [\n \"inspection\"\n ]\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://web.edcontrols.com/api/v2/data/file/{database}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"inspection-report-week-23.pdf\",\n \"fileGroupID\": \"fg-1a2b...\",\n \"tags\": [\n \"inspection\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://web.edcontrols.com/api/v2/data/file/{database}")
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 \"fileName\": \"inspection-report-week-23.pdf\",\n \"fileGroupID\": \"fg-1a2b...\",\n \"tags\": [\n \"inspection\"\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"
}Create a file
Registers a file in the project. The server downloads the binary from
fileUrl.
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.
fileName is required (at most 250 characters, as is uploadedName).
When the group already holds a file with this fileName, the upload
becomes a new version of that file; while that file is still being
processed the request is refused with 400 “Already initiated”.
Allowed for contract administrators, Accountable and Support.
curl --request POST \
--url https://web.edcontrols.com/api/v2/data/file/{database} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "inspection-report-week-23.pdf",
"fileGroupID": "fg-1a2b...",
"tags": [
"inspection"
]
}
'import requests
url = "https://web.edcontrols.com/api/v2/data/file/{database}"
payload = {
"fileName": "inspection-report-week-23.pdf",
"fileGroupID": "fg-1a2b...",
"tags": ["inspection"]
}
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({
fileName: 'inspection-report-week-23.pdf',
fileGroupID: 'fg-1a2b...',
tags: ['inspection']
})
};
fetch('https://web.edcontrols.com/api/v2/data/file/{database}', 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}",
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' => 'inspection-report-week-23.pdf',
'fileGroupID' => 'fg-1a2b...',
'tags' => [
'inspection'
]
]),
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}"
payload := strings.NewReader("{\n \"fileName\": \"inspection-report-week-23.pdf\",\n \"fileGroupID\": \"fg-1a2b...\",\n \"tags\": [\n \"inspection\"\n ]\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://web.edcontrols.com/api/v2/data/file/{database}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"inspection-report-week-23.pdf\",\n \"fileGroupID\": \"fg-1a2b...\",\n \"tags\": [\n \"inspection\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://web.edcontrols.com/api/v2/data/file/{database}")
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 \"fileName\": \"inspection-report-week-23.pdf\",\n \"fileGroupID\": \"fg-1a2b...\",\n \"tags\": [\n \"inspection\"\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"
}