example-data.com
Menu
Browse docs and collections

Overview

attachments / #358

Activity #358

User #142 attached image/webp (29748295 bytes)

6/20/2025, 6:31:28 PM

Component variants

Medium
Small

User #142 attached image/webp (29748295 bytes) · 6/20/2025, 6:31:28 PM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 358,
  "userId": 142,
  "targetType": "recipe",
  "targetId": 29,
  "url": "https://picsum.photos/seed/attachment-358/1200/300",
  "mimeType": "image/webp",
  "sizeBytes": 29748295,
  "createdAt": "2025-06-20T18:31:28.268Z"
}