example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 4 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": 73,
      "userId": 156,
      "targetType": "product",
      "targetId": 150,
      "url": "https://picsum.photos/seed/attachment-73/400/600",
      "mimeType": "image/webp",
      "sizeBytes": 43309932,
      "createdAt": "2025-07-01T13:50:45.196Z"
    },
    {
      "id": 74,
      "userId": 127,
      "targetType": "post",
      "targetId": 10,
      "url": "https://picsum.photos/seed/attachment-74/1200/300",
      "mimeType": "image/jpeg",
      "sizeBytes": 34361733,
      "createdAt": "2025-07-21T07:59:04.135Z"
    },
    {
      "id": 75,
      "userId": 247,
      "targetType": "restaurant",
      "targetId": 20,
      "url": "https://example.com/files/attachment-75.mp4",
      "mimeType": "video/mp4",
      "sizeBytes": 40020737,
      "createdAt": "2025-07-01T15:02:26.236Z"
    }
  ],
  "meta": {
    "page": 4,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=4&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=5&limit=24",
    "prev": "/api/v1/attachments?page=3&limit=24"
  }
}