example-data.com
Menu
Browse docs and collections

Overview

attachments / #251

Activity #251

User #29 attached image/png (42435245 bytes)

12/23/2025, 9:25:34 PM

Component variants

Medium
Small

User #29 attached image/png (42435245 bytes) · 12/23/2025, 9:25:34 PM

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/attachments/251"
);
const attachment = await res.json();

TypeScript example

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

const res = await fetch(
  "https://example-data.com/api/v1/attachments/251"
);
const attachment = (await res.json()) as Attachment;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/attachments/251"
)
attachment = res.json()

Response

{
  "id": 251,
  "userId": 29,
  "targetType": "comment",
  "targetId": 640,
  "url": "https://picsum.photos/seed/attachment-251/400/400",
  "mimeType": "image/png",
  "sizeBytes": 42435245,
  "createdAt": "2025-12-23T21:25:34.513Z"
}