example-data.com
Menu
Browse docs and collections

Overview

attachments / #645

Activity #645

User #21 attached image/jpeg (14287148 bytes)

6/21/2025, 3:28:10 PM

Component variants

Medium
Small

User #21 attached image/jpeg (14287148 bytes) · 6/21/2025, 3:28:10 PM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 645,
  "userId": 21,
  "targetType": "restaurant",
  "targetId": 73,
  "url": "https://picsum.photos/seed/attachment-645/1200/600",
  "mimeType": "image/jpeg",
  "sizeBytes": 14287148,
  "createdAt": "2025-06-21T15:28:10.374Z"
}