example-data.com
Menu
Browse docs and collections

Overview

attachments / #784

Activity #784

User #161 attached image/webp (35193615 bytes)

11/13/2025, 10:49:14 AM

Component variants

Medium
Small

User #161 attached image/webp (35193615 bytes) · 11/13/2025, 10:49:14 AM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 784,
  "userId": 161,
  "targetType": "comment",
  "targetId": 1180,
  "url": "https://picsum.photos/seed/attachment-784/1200/600",
  "mimeType": "image/webp",
  "sizeBytes": 35193615,
  "createdAt": "2025-11-13T10:49:14.285Z"
}