example-data.com
Menu
Browse docs and collections

Overview

attachments / #765

Activity #765

User #30 attached image/png (27266923 bytes)

5/23/2025, 11:22:04 PM

Component variants

Medium
Small

User #30 attached image/png (27266923 bytes) · 5/23/2025, 11:22:04 PM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 765,
  "userId": 30,
  "targetType": "post",
  "targetId": 429,
  "url": "https://picsum.photos/seed/attachment-765/400/800",
  "mimeType": "image/png",
  "sizeBytes": 27266923,
  "createdAt": "2025-05-23T23:22:04.473Z"
}