example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 11 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": 241,
      "userId": 216,
      "targetType": "post",
      "targetId": 84,
      "url": "https://picsum.photos/seed/attachment-241/800/400",
      "mimeType": "image/png",
      "sizeBytes": 16082663,
      "createdAt": "2025-06-06T21:30:46.919Z"
    },
    {
      "id": 242,
      "userId": 241,
      "targetType": "comment",
      "targetId": 1231,
      "url": "https://example.com/files/attachment-242.mp4",
      "mimeType": "video/mp4",
      "sizeBytes": 38130077,
      "createdAt": "2025-10-16T21:17:42.894Z"
    },
    {
      "id": 243,
      "userId": 22,
      "targetType": "product",
      "targetId": 95,
      "url": "https://picsum.photos/seed/attachment-243/1200/400",
      "mimeType": "image/webp",
      "sizeBytes": 27554700,
      "createdAt": "2025-08-31T05:03:31.154Z"
    }
  ],
  "meta": {
    "page": 11,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=11&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=12&limit=24",
    "prev": "/api/v1/attachments?page=10&limit=24"
  }
}