example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 21 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": 481,
      "userId": 224,
      "targetType": "restaurant",
      "targetId": 97,
      "url": "https://example.com/files/attachment-481.pdf",
      "mimeType": "application/pdf",
      "sizeBytes": 29603009,
      "createdAt": "2025-08-03T08:22:34.515Z"
    },
    {
      "id": 482,
      "userId": 70,
      "targetType": "restaurant",
      "targetId": 21,
      "url": "https://picsum.photos/seed/attachment-482/400/300",
      "mimeType": "image/jpeg",
      "sizeBytes": 4804364,
      "createdAt": "2026-01-17T17:45:22.540Z"
    },
    {
      "id": 483,
      "userId": 125,
      "targetType": "restaurant",
      "targetId": 55,
      "url": "https://picsum.photos/seed/attachment-483/600/400",
      "mimeType": "image/webp",
      "sizeBytes": 47693716,
      "createdAt": "2026-01-15T05:12:40.024Z"
    }
  ],
  "meta": {
    "page": 21,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=21&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=22&limit=24",
    "prev": "/api/v1/attachments?page=20&limit=24"
  }
}