List Bookmarked Spots

This guide explains how to retrieve a list of all bookmarked spots using the Aara API. We'll start with an example using curl and follow it up with JavaScript examples utilizing the native fetch API.

Curl example

curl -X GET "https://api.aara.app/v1/spots/bookmarked" \
-H "AARA_API_KEY: YOUR_API_KEY" \
-H "UNIQUE_USER_ID: UNIQUE_USER_ID"

JavaScript example

const listBookmarkedSpots = async () => {
  const response = await fetch("https://api.aara.app/v1/spots/bookmarked", {
    method: "GET",
    headers: {
      AARA_API_KEY: "YOUR_API_KEY",
      UNIQUE_USER_ID: "UNIQUE_USER_ID",
    },
  });

  const data = await response.json();
  console.log(data);
};

listBookmarkedSpots();

Instructions:

  • Replace YOUR_API_KEY and UNIQUE_USER_ID with your actual credentials.
  • This API call will return a list of all spots that the user has bookmarked.

Response

The response from the API will be a JSON object containing an array of bookmarked spots, with each spot including details like name, location, category, and media.


Example Response

[
  {
    id: "abcdefghijklmn1234567890",
    name: "The Crying Tiger",
    shortDescription:
      "A local’s favourite, the Crying Tiger offers delicious Thai food in a warm and lovely bistro setting.",
    phone: "+33 1 40 47 07 54",
    fullAddress: "72 Rue du Cherche-Midi, 75006 Paris, France",
    lat: 48.8483422,
    lng: 2.3239264,
    isBookmarked: true,
    category: {
      id: "abcdefghijklmn1234567890",
      name: "Food",
    },
    medias: [
      {
        id: "abcdefghijklmn1234567890",
        url: "https://example.com/image1.jpg",
      },
    ],
  },
  {
    id: "abcdefghijklmn1234567890",
    name: "Louvre Museum",
    shortDescription: "World's largest art museum...",
    phone: "+33 1 40 20 50 50",
    fullAddress: "Rue de Rivoli, 75001 Paris, France",
    lat: 48.8606111,
    lng: 2.337644,
    isBookmarked: true,
    category: {
      id: "abcdefghijklmn1234567890",
      name: "Museum",
    },
    medias: [
      {
        id: "abcdefghijklmn1234567890",
        url: "https://example.com/image2.jpg",
      },
    ],
  },
];

This response shows a list of bookmarked spots with details like name, description, location, category, and media associated with each spot.