example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 30 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": 697,
      "userId": 126,
      "targetType": "restaurant",
      "targetId": 90,
      "url": "https://picsum.photos/seed/attachment-697/400/600",
      "mimeType": "image/jpeg",
      "sizeBytes": 1578365,
      "createdAt": "2025-06-25T13:01:58.125Z"
    },
    {
      "id": 698,
      "userId": 84,
      "targetType": "post",
      "targetId": 304,
      "url": "https://example.com/files/attachment-698.mp4",
      "mimeType": "video/mp4",
      "sizeBytes": 8220544,
      "createdAt": "2025-06-06T13:05:43.382Z"
    },
    {
      "id": 699,
      "userId": 120,
      "targetType": "comment",
      "targetId": 1494,
      "url": "https://picsum.photos/seed/attachment-699/400/300",
      "mimeType": "image/webp",
      "sizeBytes": 13740085,
      "createdAt": "2026-05-21T00:23:12.897Z"
    }
  ],
  "meta": {
    "page": 30,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=30&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=31&limit=24",
    "prev": "/api/v1/attachments?page=29&limit=24"
  }
}