example-data.com
Menu
Browse docs and collections

Overview

files / #581

Component variants

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/files/581" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/files/581"
);
const file = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/files.d.ts https://example-data.com/types/files.d.ts
import type { File } from "./types/files";

const res = await fetch(
  "https://example-data.com/api/v1/files/581"
);
const file = (await res.json()) as File;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/files/581"
)
file = res.json()

Response

{
  "id": 581,
  "ownerUserId": 35,
  "name": "script-WyfXD1.txt",
  "mimeType": "text/plain",
  "sizeBytes": 18876935,
  "url": "https://files.example.com/objects/581/script-WyfXD1.txt",
  "parentFolderId": 51,
  "isFolder": false,
  "createdAt": "2024-07-29T08:44:46.950Z",
  "updatedAt": "2024-08-03T05:52:13.386Z"
}