example-data.com
Menu
Browse docs and collections

Overview

attachments / #733

Activity #733

User #58 attached image/webp (39910326 bytes)

6/18/2025, 1:18:52 PM

Component variants

Medium
Small

User #58 attached image/webp (39910326 bytes) · 6/18/2025, 1:18:52 PM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 733,
  "userId": 58,
  "targetType": "comment",
  "targetId": 977,
  "url": "https://picsum.photos/seed/attachment-733/1200/800",
  "mimeType": "image/webp",
  "sizeBytes": 39910326,
  "createdAt": "2025-06-18T13:18:52.806Z"
}