example-data.com
Menu
Browse docs and collections

Overview

attachments / #7

Activity #7

User #128 attached image/png (5392711 bytes)

11/18/2025, 12:54:59 AM

Component variants

Medium
Small

User #128 attached image/png (5392711 bytes) · 11/18/2025, 12:54:59 AM

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/attachments/7"
);
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/7"
);
const attachment = (await res.json()) as Attachment;

Python example

import requests

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

Response

{
  "id": 7,
  "userId": 128,
  "targetType": "comment",
  "targetId": 763,
  "url": "https://picsum.photos/seed/attachment-7/600/400",
  "mimeType": "image/png",
  "sizeBytes": 5392711,
  "createdAt": "2025-11-18T00:54:59.690Z"
}