example-data.com
Menu
Browse docs and collections

Overview

attachments / #215

Activity #215

User #27 attached image/jpeg (22455904 bytes)

11/4/2025, 7:15:28 AM

Component variants

Medium
Small

User #27 attached image/jpeg (22455904 bytes) · 11/4/2025, 7:15:28 AM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 215,
  "userId": 27,
  "targetType": "comment",
  "targetId": 141,
  "url": "https://picsum.photos/seed/attachment-215/1200/300",
  "mimeType": "image/jpeg",
  "sizeBytes": 22455904,
  "createdAt": "2025-11-04T07:15:28.106Z"
}