example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 6 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": 121,
      "userId": 177,
      "targetType": "restaurant",
      "targetId": 71,
      "url": "https://picsum.photos/seed/attachment-121/400/800",
      "mimeType": "image/png",
      "sizeBytes": 35683638,
      "createdAt": "2026-05-02T05:19:32.241Z"
    },
    {
      "id": 122,
      "userId": 164,
      "targetType": "comment",
      "targetId": 1389,
      "url": "https://picsum.photos/seed/attachment-122/600/600",
      "mimeType": "image/png",
      "sizeBytes": 3813287,
      "createdAt": "2025-10-03T05:28:49.056Z"
    },
    {
      "id": 123,
      "userId": 116,
      "targetType": "product",
      "targetId": 53,
      "url": "https://example.com/files/attachment-123.mp4",
      "mimeType": "video/mp4",
      "sizeBytes": 8171127,
      "createdAt": "2025-06-26T12:11:41.535Z"
    }
  ],
  "meta": {
    "page": 6,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=6&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=7&limit=24",
    "prev": "/api/v1/attachments?page=5&limit=24"
  }
}