example-data.com
Menu
Browse docs and collections

Overview

attachments / #782

Activity #782

User #197 attached image/png (33892310 bytes)

10/5/2025, 8:44:11 AM

Component variants

Medium
Small

User #197 attached image/png (33892310 bytes) · 10/5/2025, 8:44:11 AM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 782,
  "userId": 197,
  "targetType": "recipe",
  "targetId": 184,
  "url": "https://picsum.photos/seed/attachment-782/600/400",
  "mimeType": "image/png",
  "sizeBytes": 33892310,
  "createdAt": "2025-10-05T08:44:11.865Z"
}