example-data.com
Menu
Browse docs and collections

Overview

attachments / #732

Activity #732

User #112 attached image/jpeg (11927580 bytes)

8/4/2025, 4:30:54 AM

Component variants

Medium
Small

User #112 attached image/jpeg (11927580 bytes) · 8/4/2025, 4:30:54 AM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 732,
  "userId": 112,
  "targetType": "product",
  "targetId": 41,
  "url": "https://picsum.photos/seed/attachment-732/1200/300",
  "mimeType": "image/jpeg",
  "sizeBytes": 11927580,
  "createdAt": "2025-08-04T04:30:54.217Z"
}