example-data.com
Menu
Browse docs and collections

Overview

attachments / #117

Activity #117

User #108 attached image/webp (5321345 bytes)

9/26/2025, 8:53:01 PM

Component variants

Medium
Small

User #108 attached image/webp (5321345 bytes) · 9/26/2025, 8:53:01 PM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 117,
  "userId": 108,
  "targetType": "post",
  "targetId": 442,
  "url": "https://picsum.photos/seed/attachment-117/600/400",
  "mimeType": "image/webp",
  "sizeBytes": 5321345,
  "createdAt": "2025-09-26T20:53:01.177Z"
}