example-data.com
Menu
Browse docs and collections

Overview

attachments / #420

Activity #420

User #105 attached image/jpeg (8871327 bytes)

10/3/2025, 7:12:47 AM

Component variants

Medium
Small

User #105 attached image/jpeg (8871327 bytes) · 10/3/2025, 7:12:47 AM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 420,
  "userId": 105,
  "targetType": "restaurant",
  "targetId": 47,
  "url": "https://picsum.photos/seed/attachment-420/400/400",
  "mimeType": "image/jpeg",
  "sizeBytes": 8871327,
  "createdAt": "2025-10-03T07:12:47.948Z"
}