silverbulletmd / silverbullet

The knowledge tinkerer's notebook
https://silverbullet.md
MIT License
2.43k stars 174 forks source link

GET request to /index.json returning HTML for main page #1029

Closed stevegg closed 2 months ago

stevegg commented 2 months ago

Hi,

I'm trying to understand how to use the API to programatically fetch all documents within my notes instance. My notes are running on a local server with the ip: 10.0.1.234 so my request is:

curl --location 'http://10.0.1.234/index.json'

This is returning the first page of my notes instead of the expected JSON.

`<!DOCTYPE html>

index ` I'm running Silverbullet 0.9.0 via Deno. What am I doing wrong here? I've also tried adding headers for Accept like this: `curl --location 'http://10.0.1.234/index.json' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json'` Any help would be greatly appreciated.
zefhemel commented 2 months ago

Have a look at this: https://silverbullet.md/API

You're missing an x-sync-mode header.

stevegg commented 2 months ago

Have a look at this: https://silverbullet.md/API

You're missing an x-sync-mode header.

Well I knew it would end up being something simple. Thought I had read that document a few times but missed that completely. Thank you!

Steve