example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 14 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": 313,
      "userId": 45,
      "targetType": "post",
      "targetId": 298,
      "url": "https://picsum.photos/seed/attachment-313/800/600",
      "mimeType": "image/jpeg",
      "sizeBytes": 28818327,
      "createdAt": "2026-03-03T21:54:01.137Z"
    },
    {
      "id": 314,
      "userId": 24,
      "targetType": "product",
      "targetId": 9,
      "url": "https://picsum.photos/seed/attachment-314/800/400",
      "mimeType": "image/jpeg",
      "sizeBytes": 31085071,
      "createdAt": "2026-01-07T19:03:17.970Z"
    },
    {
      "id": 315,
      "userId": 202,
      "targetType": "product",
      "targetId": 142,
      "url": "https://example.com/files/attachment-315.pdf",
      "mimeType": "application/pdf",
      "sizeBytes": 19479001,
      "createdAt": "2026-03-09T10:15:18.001Z"
    }
  ],
  "meta": {
    "page": 14,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=14&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=15&limit=24",
    "prev": "/api/v1/attachments?page=13&limit=24"
  }
}