example-data.com
Menu
Browse docs and collections

Overview

comments / #501

Comment #501

· 12/16/2024

Brevis comparo cinis cernuus uberrime.

Component variants

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/comments/501" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/comments/501"
);
const comment = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/comments.d.ts https://example-data.com/types/comments.d.ts
import type { Comment } from "./types/comments";

const res = await fetch(
  "https://example-data.com/api/v1/comments/501"
);
const comment = (await res.json()) as Comment;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/comments/501"
)
comment = res.json()

Response

{
  "id": 501,
  "userId": 8,
  "targetType": "post",
  "targetId": 339,
  "body": "Brevis comparo cinis cernuus uberrime.",
  "isEdited": false,
  "createdAt": "2024-12-16T20:08:09.144Z",
  "updatedAt": "2024-12-16T20:08:09.144Z"
}