Notes Endpoints
Get All Notes
Retrieve all notes from the database
GET
/
api
/
notes
Get All Notes
curl --request GET \
--url https://arfan-notes.val.run/api/notesimport requests
url = "https://arfan-notes.val.run/api/notes"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://arfan-notes.val.run/api/notes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://arfan-notes.val.run/api/notes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://arfan-notes.val.run/api/notes"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://arfan-notes.val.run/api/notes")
.asString();require 'uri'
require 'net/http'
url = URI("https://arfan-notes.val.run/api/notes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"id": 1,
"title": "CSS Grid Layout",
"content": "CSS Grid is a powerful layout system...",
"category": "css",
"group": "first",
"color": "primary",
"archived": false,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
{
"id": 2,
"title": "Val Town Functions",
"content": "Val Town is a platform for writing...",
"category": "val-town",
"group": "second",
"color": "info",
"archived": false,
"createdAt": "2024-01-16T14:22:00Z",
"updatedAt": "2024-01-16T14:22:00Z"
}
]
Get All Notes
Retrieves all notes stored in the database. This endpoint returns an array of note objects with all their properties.Endpoint
curl -X GET "https://arfan-notes.val.run/api/notes" \
-H "Content-Type: application/json"
const response = await fetch('https://arfan-notes.val.run/api/notes', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
const notes = await response.json();
console.log(notes);
import requests
response = requests.get('https://arfan-notes.val.run/api/notes')
notes = response.json()
print(notes)
Response
[
{
"id": 1,
"title": "CSS Grid Layout",
"content": "CSS Grid is a powerful layout system...",
"category": "css",
"group": "first",
"color": "primary",
"archived": false,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
{
"id": 2,
"title": "Val Town Functions",
"content": "Val Town is a platform for writing...",
"category": "val-town",
"group": "second",
"color": "info",
"archived": false,
"createdAt": "2024-01-16T14:22:00Z",
"updatedAt": "2024-01-16T14:22:00Z"
}
]
Response Fields
integer
Unique identifier for the note
string
The title of the note
string
The main content/body of the note
string
Category classification (css, val-town, prompts, notes, chat-gpt, cursor-chats, bash-commands)
string
Group classification (first, second, third, fourth, fifth)
string
Visual color coding (primary, secondary, accent, neutral, info, success, warning, error)
boolean
Whether the note is archived or not
datetime
Timestamp when the note was created
datetime
Timestamp when the note was last updated
⌘I
Get All Notes
curl --request GET \
--url https://arfan-notes.val.run/api/notesimport requests
url = "https://arfan-notes.val.run/api/notes"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://arfan-notes.val.run/api/notes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://arfan-notes.val.run/api/notes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://arfan-notes.val.run/api/notes"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://arfan-notes.val.run/api/notes")
.asString();require 'uri'
require 'net/http'
url = URI("https://arfan-notes.val.run/api/notes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"id": 1,
"title": "CSS Grid Layout",
"content": "CSS Grid is a powerful layout system...",
"category": "css",
"group": "first",
"color": "primary",
"archived": false,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
{
"id": 2,
"title": "Val Town Functions",
"content": "Val Town is a platform for writing...",
"category": "val-town",
"group": "second",
"color": "info",
"archived": false,
"createdAt": "2024-01-16T14:22:00Z",
"updatedAt": "2024-01-16T14:22:00Z"
}
]