example-data.com
Menu
Browse docs and collections

Overview

attachments / #337

Activity #337

User #191 attached image/png (20044753 bytes)

10/3/2025, 3:19:32 AM

Component variants

Medium
Small

User #191 attached image/png (20044753 bytes) · 10/3/2025, 3:19:32 AM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 337,
  "userId": 191,
  "targetType": "post",
  "targetId": 198,
  "url": "https://picsum.photos/seed/attachment-337/400/600",
  "mimeType": "image/png",
  "sizeBytes": 20044753,
  "createdAt": "2025-10-03T03:19:32.532Z"
}