example-data.com
Menu
Browse docs and collections

Overview

attachments / #321

Activity #321

User #117 attached image/png (3789383 bytes)

7/28/2025, 10:22:09 PM

Component variants

Medium
Small

User #117 attached image/png (3789383 bytes) · 7/28/2025, 10:22:09 PM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 321,
  "userId": 117,
  "targetType": "product",
  "targetId": 103,
  "url": "https://picsum.photos/seed/attachment-321/800/400",
  "mimeType": "image/png",
  "sizeBytes": 3789383,
  "createdAt": "2025-07-28T22:22:09.224Z"
}