example-data.com
Menu
Browse docs and collections

Overview

attachments / #122

Activity #122

User #164 attached image/png (3813287 bytes)

10/3/2025, 5:28:49 AM

Component variants

Medium
Small

User #164 attached image/png (3813287 bytes) · 10/3/2025, 5:28:49 AM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 122,
  "userId": 164,
  "targetType": "comment",
  "targetId": 1389,
  "url": "https://picsum.photos/seed/attachment-122/600/600",
  "mimeType": "image/png",
  "sizeBytes": 3813287,
  "createdAt": "2025-10-03T05:28:49.056Z"
}