example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 24 of 34.

Overview

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/attachments?limit=25"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/attachments?limit=25"
);
const { data, meta } = 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, ListEnvelope } from "./types/attachments";

const res = await fetch(
  "https://example-data.com/api/v1/attachments?limit=25"
);
const { data, meta } = (await res.json()) as ListEnvelope<Attachment>;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/attachments",
    params={"limit": 25},
)
data = res.json()

Response

{
  "data": [
    {
      "id": 553,
      "userId": 41,
      "targetType": "comment",
      "targetId": 1397,
      "url": "https://picsum.photos/seed/attachment-553/1200/800",
      "mimeType": "image/png",
      "sizeBytes": 46201397,
      "createdAt": "2026-04-18T23:49:39.436Z"
    },
    {
      "id": 554,
      "userId": 171,
      "targetType": "comment",
      "targetId": 154,
      "url": "https://picsum.photos/seed/attachment-554/1200/300",
      "mimeType": "image/webp",
      "sizeBytes": 31525899,
      "createdAt": "2026-05-03T20:27:27.361Z"
    },
    {
      "id": 555,
      "userId": 185,
      "targetType": "post",
      "targetId": 219,
      "url": "https://example.com/files/attachment-555.pdf",
      "mimeType": "application/pdf",
      "sizeBytes": 13427316,
      "createdAt": "2025-11-06T12:17:43.458Z"
    }
  ],
  "meta": {
    "page": 24,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=24&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=25&limit=24",
    "prev": "/api/v1/attachments?page=23&limit=24"
  }
}