example-data.com
Menu
Browse docs and collections

Overview

reactions / #20

Activity #20

User #2 reacted sad post #130

11/4/2024, 7:15:40 PM

Component variants

Medium
Small

User #2 reacted sad post #130 · 11/4/2024, 7:15:40 PM

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/reactions/20"
);
const reaction = await res.json();

TypeScript example

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

const res = await fetch(
  "https://example-data.com/api/v1/reactions/20"
);
const reaction = (await res.json()) as Reaction;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/reactions/20"
)
reaction = res.json()

Response

{
  "id": 20,
  "userId": 2,
  "targetType": "post",
  "targetId": 130,
  "type": "sad",
  "createdAt": "2024-11-04T19:15:40.733Z"
}