example-data.com
Menu
Browse docs and collections

Overview

cars-saved / #332

Activity #332

User #215 saved Car #174

11/18/2024, 2:33:40 PM

Component variants

Medium
Small

User #215 saved Car #174 · 11/18/2024, 2:33:40 PM

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/cars-saved/332" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/cars-saved/332"
);
const carSaved = await res.json();

TypeScript example

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

const res = await fetch(
  "https://example-data.com/api/v1/cars-saved/332"
);
const carSaved = (await res.json()) as CarSaved;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/cars-saved/332"
)
cars_saved = res.json()

Response

{
  "id": 332,
  "userId": 215,
  "carId": 174,
  "savedAt": "2024-11-18T14:33:40.529Z"
}