example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 27 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": 625,
      "userId": 210,
      "targetType": "recipe",
      "targetId": 111,
      "url": "https://example.com/files/attachment-625.pdf",
      "mimeType": "application/pdf",
      "sizeBytes": 40258637,
      "createdAt": "2025-11-22T16:26:48.260Z"
    },
    {
      "id": 626,
      "userId": 15,
      "targetType": "product",
      "targetId": 22,
      "url": "https://picsum.photos/seed/attachment-626/400/600",
      "mimeType": "image/webp",
      "sizeBytes": 39788738,
      "createdAt": "2026-02-21T11:20:36.739Z"
    },
    {
      "id": 627,
      "userId": 107,
      "targetType": "recipe",
      "targetId": 225,
      "url": "https://picsum.photos/seed/attachment-627/400/400",
      "mimeType": "image/jpeg",
      "sizeBytes": 30370463,
      "createdAt": "2025-11-12T12:53:55.617Z"
    }
  ],
  "meta": {
    "page": 27,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=27&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=28&limit=24",
    "prev": "/api/v1/attachments?page=26&limit=24"
  }
}