example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 22 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": 505,
      "userId": 203,
      "targetType": "product",
      "targetId": 43,
      "url": "https://picsum.photos/seed/attachment-505/800/400",
      "mimeType": "image/webp",
      "sizeBytes": 8265051,
      "createdAt": "2025-06-30T18:40:43.747Z"
    },
    {
      "id": 506,
      "userId": 221,
      "targetType": "product",
      "targetId": 108,
      "url": "https://example.com/files/attachment-506.pdf",
      "mimeType": "application/pdf",
      "sizeBytes": 31627007,
      "createdAt": "2025-10-18T06:04:21.883Z"
    },
    {
      "id": 507,
      "userId": 211,
      "targetType": "comment",
      "targetId": 1225,
      "url": "https://picsum.photos/seed/attachment-507/800/400",
      "mimeType": "image/webp",
      "sizeBytes": 43512728,
      "createdAt": "2026-02-12T07:06:44.029Z"
    }
  ],
  "meta": {
    "page": 22,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=22&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=23&limit=24",
    "prev": "/api/v1/attachments?page=21&limit=24"
  }
}