example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 33 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": 769,
      "userId": 234,
      "targetType": "post",
      "targetId": 306,
      "url": "https://picsum.photos/seed/attachment-769/600/600",
      "mimeType": "image/png",
      "sizeBytes": 15601062,
      "createdAt": "2025-10-01T17:41:53.271Z"
    },
    {
      "id": 770,
      "userId": 17,
      "targetType": "comment",
      "targetId": 1154,
      "url": "https://example.com/files/attachment-770.pdf",
      "mimeType": "application/pdf",
      "sizeBytes": 21352262,
      "createdAt": "2025-11-04T00:38:04.531Z"
    },
    {
      "id": 771,
      "userId": 183,
      "targetType": "restaurant",
      "targetId": 2,
      "url": "https://example.com/files/attachment-771.pdf",
      "mimeType": "application/pdf",
      "sizeBytes": 42634112,
      "createdAt": "2025-09-06T18:24:11.538Z"
    }
  ],
  "meta": {
    "page": 33,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=33&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=34&limit=24",
    "prev": "/api/v1/attachments?page=32&limit=24"
  }
}