Request a signed upload URL
curl --request POST \
--url https://api.prd.realitydefender.xyz/api/files/aws-presigned \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"fileName": "your-file.mp4"
}
'import requests
url = "https://api.prd.realitydefender.xyz/api/files/aws-presigned"
payload = { "fileName": "your-file.mp4" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: 'your-file.mp4'})
};
fetch('https://api.prd.realitydefender.xyz/api/files/aws-presigned', 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.prd.realitydefender.xyz/api/files/aws-presigned",
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' => 'your-file.mp4'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/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.prd.realitydefender.xyz/api/files/aws-presigned"
payload := strings.NewReader("{\n \"fileName\": \"your-file.mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.prd.realitydefender.xyz/api/files/aws-presigned")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"your-file.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prd.realitydefender.xyz/api/files/aws-presigned")
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["Content-Type"] = 'application/json'
request.body = "{\n \"fileName\": \"your-file.mp4\"\n}"
response = http.request(request)
puts response.read_body{
"code": "ok",
"errno": 0,
"mediaId": "8b0d4c1e-2f3a-4b5c-8d6e-7f8a9b0c1d2e",
"requestId": "8b0d4c1e-2f3a-4b5c-8d6e-7f8a9b0c1d2e",
"response": {
"signedUrl": "https://api.prd.realitydefender.xyz/api/files/8b0d4c1e-2f3a-4b5c-8d6e-7f8a9b0c1d2e?token=<token>"
}
}{
"statusCode": 400,
"path": "<string>",
"message": "<string>",
"code": "<string>",
"type": "<string>",
"name": "<string>",
"explanation": "<string>"
}{
"statusCode": 401,
"path": "<string>",
"message": "<string>",
"code": "<string>",
"type": "<string>",
"name": "<string>",
"explanation": "<string>"
}{
"statusCode": 403,
"path": "<string>",
"message": "<string>",
"code": "<string>",
"type": "<string>",
"name": "<string>",
"explanation": "<string>"
}{
"statusCode": 415,
"path": "<string>",
"message": "<string>",
"code": "<string>",
"type": "<string>",
"name": "<string>",
"explanation": "<string>"
}{
"statusCode": 123,
"path": "<string>",
"message": "<string>",
"code": "<string>",
"type": "<string>",
"name": "<string>",
"explanation": "<string>"
}RealScan
Request a signed upload URL
Step 1 of 2 of the file upload flow. Returns a temporary upload URL in
response.signedUrl and the requestId used later to fetch the result
from GET /api/media/users/{requestId}. Step 2 is to PUT the file to
that URL (PUT /api/files/{requestId}).
Supported file types
- Images:
.jpg,.jpeg,.png,.gif,.webp,.heic,.heif,.avif - Audio:
.wav,.mp3,.ogg,.amr,.flac,.aac,.m4a,.alac - Video:
.mp4,.mov,.mkv,.webm,.avi,.ts - Text:
.txt,.rtf
Size limits
- Text: up to 900 KB
- Images: up to 50 MB
- Audio: up to 20 MB
- Video: up to 250 MB. Videos longer than 30 minutes are accepted but
not analyzed (NOT_APPLICABLE reason
duration: video too long).
Filename rules
- Maximum length: 200 characters, including the extension
- The extension is matched case-insensitively
- The scan’s
filenameis a normalized copy (runs of non-word characters become_, lowercased, with a timestamp suffix);originalFileNamekeeps the name as sent.
POST
/
api
/
files
/
aws-presigned
Request a signed upload URL
curl --request POST \
--url https://api.prd.realitydefender.xyz/api/files/aws-presigned \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"fileName": "your-file.mp4"
}
'import requests
url = "https://api.prd.realitydefender.xyz/api/files/aws-presigned"
payload = { "fileName": "your-file.mp4" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: 'your-file.mp4'})
};
fetch('https://api.prd.realitydefender.xyz/api/files/aws-presigned', 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.prd.realitydefender.xyz/api/files/aws-presigned",
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' => 'your-file.mp4'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/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.prd.realitydefender.xyz/api/files/aws-presigned"
payload := strings.NewReader("{\n \"fileName\": \"your-file.mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.prd.realitydefender.xyz/api/files/aws-presigned")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"your-file.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prd.realitydefender.xyz/api/files/aws-presigned")
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["Content-Type"] = 'application/json'
request.body = "{\n \"fileName\": \"your-file.mp4\"\n}"
response = http.request(request)
puts response.read_body{
"code": "ok",
"errno": 0,
"mediaId": "8b0d4c1e-2f3a-4b5c-8d6e-7f8a9b0c1d2e",
"requestId": "8b0d4c1e-2f3a-4b5c-8d6e-7f8a9b0c1d2e",
"response": {
"signedUrl": "https://api.prd.realitydefender.xyz/api/files/8b0d4c1e-2f3a-4b5c-8d6e-7f8a9b0c1d2e?token=<token>"
}
}{
"statusCode": 400,
"path": "<string>",
"message": "<string>",
"code": "<string>",
"type": "<string>",
"name": "<string>",
"explanation": "<string>"
}{
"statusCode": 401,
"path": "<string>",
"message": "<string>",
"code": "<string>",
"type": "<string>",
"name": "<string>",
"explanation": "<string>"
}{
"statusCode": 403,
"path": "<string>",
"message": "<string>",
"code": "<string>",
"type": "<string>",
"name": "<string>",
"explanation": "<string>"
}{
"statusCode": 415,
"path": "<string>",
"message": "<string>",
"code": "<string>",
"type": "<string>",
"name": "<string>",
"explanation": "<string>"
}{
"statusCode": 123,
"path": "<string>",
"message": "<string>",
"code": "<string>",
"type": "<string>",
"name": "<string>",
"explanation": "<string>"
}Authorizations
Body
application/json
Response
Signed upload URL and the request ID of the new scan