curl --request PUT \
--url https://apix.us.amity.co/api/v3/network-settings/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"useLegacyFileDownload": true,
"reservedForReview": false
}
'import requests
url = "https://apix.us.amity.co/api/v3/network-settings/files"
payload = {
"useLegacyFileDownload": True,
"reservedForReview": False
}
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({useLegacyFileDownload: true, reservedForReview: false})
};
fetch('https://apix.us.amity.co/api/v3/network-settings/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://apix.us.amity.co/api/v3/network-settings/files",
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([
'useLegacyFileDownload' => true,
'reservedForReview' => false
]),
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://apix.us.amity.co/api/v3/network-settings/files"
payload := strings.NewReader("{\n \"useLegacyFileDownload\": true,\n \"reservedForReview\": false\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://apix.us.amity.co/api/v3/network-settings/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"useLegacyFileDownload\": true,\n \"reservedForReview\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v3/network-settings/files")
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 \"useLegacyFileDownload\": true,\n \"reservedForReview\": false\n}"
response = http.request(request)
puts response.read_body{
"useLegacyFileDownload": true,
"reservedForReview": false
}{
"status": "error",
"code": 400000,
"message": "Bad Request."
}{
"status": "error",
"code": 500000,
"message": "Unexpected error"
}Update file configuration.
Update how the network handles files: the delivery path (useLegacyFileDownload) and
whether an upload that pre-moderation refused is kept for review (reservedForReview).
The response is read back after the write, not echoed from the request.
curl --request PUT \
--url https://apix.us.amity.co/api/v3/network-settings/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"useLegacyFileDownload": true,
"reservedForReview": false
}
'import requests
url = "https://apix.us.amity.co/api/v3/network-settings/files"
payload = {
"useLegacyFileDownload": True,
"reservedForReview": False
}
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({useLegacyFileDownload: true, reservedForReview: false})
};
fetch('https://apix.us.amity.co/api/v3/network-settings/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://apix.us.amity.co/api/v3/network-settings/files",
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([
'useLegacyFileDownload' => true,
'reservedForReview' => false
]),
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://apix.us.amity.co/api/v3/network-settings/files"
payload := strings.NewReader("{\n \"useLegacyFileDownload\": true,\n \"reservedForReview\": false\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://apix.us.amity.co/api/v3/network-settings/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"useLegacyFileDownload\": true,\n \"reservedForReview\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v3/network-settings/files")
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 \"useLegacyFileDownload\": true,\n \"reservedForReview\": false\n}"
response = http.request(request)
puts response.read_body{
"useLegacyFileDownload": true,
"reservedForReview": false
}{
"status": "error",
"code": 400000,
"message": "Bad Request."
}{
"status": "error",
"code": 500000,
"message": "Unexpected error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
file handling for the network. Both switches are global to the network.
Serve file downloads through the legacy delivery path.
Keep the bytes of an upload that pre-moderation refused, so the decision can be reviewed.
The file record is kept with a rejection and the upload raises file.didReject rather
than file.didUpload. Left off, a refused upload is discarded.
Response
File configuration
Serve file downloads through the legacy delivery path.
Keep the bytes of an upload that pre-moderation refused, so the decision can be reviewed.
The file record is kept with a rejection and the upload raises file.didReject rather
than file.didUpload. Left off, a refused upload is discarded.