example-data.com
Menu
Browse docs and collections

Overview

attachments / #345

Activity #345

User #156 attached application/pdf (24191705 bytes)

5/28/2025, 7:03:31 AM

Component variants

Medium
Small

User #156 attached application/pdf (24191705 bytes) · 5/28/2025, 7:03:31 AM

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 345,
  "userId": 156,
  "targetType": "recipe",
  "targetId": 44,
  "url": "https://example.com/files/attachment-345.pdf",
  "mimeType": "application/pdf",
  "sizeBytes": 24191705,
  "createdAt": "2025-05-28T07:03:31.401Z"
}