example-data.com
Menu
Browse docs and collections

Overview

attachments / #769

Activity #769

User #234 attached image/png (15601062 bytes)

10/1/2025, 5:41:53 PM

Component variants

Medium
Small

User #234 attached image/png (15601062 bytes) · 10/1/2025, 5:41:53 PM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 769,
  "userId": 234,
  "targetType": "post",
  "targetId": 306,
  "url": "https://picsum.photos/seed/attachment-769/600/600",
  "mimeType": "image/png",
  "sizeBytes": 15601062,
  "createdAt": "2025-10-01T17:41:53.271Z"
}