example-data.com
Menu
Browse docs and collections

Overview

attachments / #680

Activity #680

User #180 attached image/png (44075549 bytes)

6/17/2025, 2:32:14 AM

Component variants

Medium
Small

User #180 attached image/png (44075549 bytes) · 6/17/2025, 2:32:14 AM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 680,
  "userId": 180,
  "targetType": "post",
  "targetId": 339,
  "url": "https://picsum.photos/seed/attachment-680/600/400",
  "mimeType": "image/png",
  "sizeBytes": 44075549,
  "createdAt": "2025-06-17T02:32:14.631Z"
}