Download a report
GET /api/Subjects/{subjectId}/downloadBackgroundReportAuthentication
Section titled “Authentication”Send your private API key in the X-Api-Key header. Keep it on your server.
Request example
Section titled “Request example”Examples use illustrative values. Set FERRETLY_API_KEY in your server environment for JavaScript, Python, and C#. Replace sample IDs, URLs, and profile values before use.
curl --fail -sS -X GET "https://api.ferretly.com/api/Subjects/11111111-1111-4111-8111-111111111111/downloadBackgroundReport" \ -H "X-Api-Key: YOUR_API_KEY" \ -H "Accept: application/octet-stream" \ -o report.binconst response = await fetch("https://api.ferretly.com/api/Subjects/11111111-1111-4111-8111-111111111111/downloadBackgroundReport", { "method": "GET", "headers": { "X-Api-Key": process.env.FERRETLY_API_KEY, "Accept": "application/octet-stream" }});if (!response.ok) throw new Error("HTTP " + response.status);const { writeFile } = await import("node:fs/promises");await writeFile("report.bin", Buffer.from(await response.arrayBuffer()));import osimport requests
response = requests.request( "GET", "https://api.ferretly.com/api/Subjects/11111111-1111-4111-8111-111111111111/downloadBackgroundReport", headers={"X-Api-Key":os.environ["FERRETLY_API_KEY"],"Accept":"application/octet-stream"}, timeout=30,)response.raise_for_status()with open("report.bin", "wb") as report: report.write(response.content)using System;using System.IO;using System.Net.Http;using System.Text;
using var http = new HttpClient();using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.ferretly.com/api/Subjects/11111111-1111-4111-8111-111111111111/downloadBackgroundReport");request.Headers.Add("X-Api-Key", Environment.GetEnvironmentVariable("FERRETLY_API_KEY"));request.Headers.Accept.ParseAdd("application/octet-stream");using var response = await http.SendAsync(request);response.EnsureSuccessStatusCode();await File.WriteAllBytesAsync("report.bin", await response.Content.ReadAsByteArrayAsync());Parameters
Section titled “Parameters”| Name | In | Required | Type | Description |
|---|---|---|---|---|
subjectId | path | Yes | string (uuid) |
Responses
Section titled “Responses”Success
application/octet-stream: string (binary)
The subject does not have a current background report, or it is being regenerated
Subject not found, or report file could not be located in Blob Storage
Save the response as a binary file. The filename and report availability are described in Results and reports.