theogf / Remarkable.jl

Julia API to the Remarkable cloud
MIT License
38 stars 4 forks source link

401 error on calling list_items #23

Open supertrianguloid opened 2 years ago

supertrianguloid commented 2 years ago

I followed the documentation, obtained a token and I can run RemarkableClient(), however when I run list_items(client) I get

ERROR: HTTP.ExceptionRequest.StatusError(401, "GET", "/document-storage/json/2/docs", HTTP.Messages.Response:
"""
HTTP/1.1 401 Unauthorized
X-Appengine-Log-Flush-Count: 1
X-Cloud-Trace-Context: d93f350e79df03bd5e7411605c1d1ef2
Date: Sat, 09 Jul 2022 16:14:20 GMT
Content-Type: text/html
Server: Google Frontend
Content-Length: 0
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"

""")
theogf commented 2 years ago

Thanks! I am looking into this right now!

theogf commented 2 years ago

Looks like there is a rolling to a new cloud API 1.5. Luckily some good people figured out the new links and calls. I will make a PR to adapt Remarkable.jl to it

Amval commented 1 year ago

Hi, @theogf I am not very familiar with the API (just tried to run this project for the first time), otherwise I would do a PR. But I think this commit might be of interest to fix this problem: https://github.com/juruen/rmapi/pull/260/commits/611668063c8d42be6c0f1dbdb562ba16f1345619

blegat commented 7 months ago

Luckily some good people figured out the new links and calls

It seems to be using this link https://github.com/theogf/Remarkable.jl/blob/ba6bea95b7cabb6c4f225dfe97dfd5dffd242725/src/const.jl#L5 with https://github.com/theogf/Remarkable.jl/blob/ba6bea95b7cabb6c4f225dfe97dfd5dffd242725/src/const.jl#L11 It seems the other projects didn't change this link recently, did you find any ?

theogf commented 7 months ago

I think I had a look and it was a bit inconclusive. I tried a few of the findings but without success... It might worth asking on the Discord

blegat commented 7 months ago

I made a post : https://discord.com/channels/385916768696139794/1203250594580529183 Otherwise I guess we can try listening to the official discord client with Wireshark or equivalent

blegat commented 7 months ago

rmapi seems to be working for the v1.5 of the api with what's in their api/sync15 folder. It seems we need to first do https://github.com/juruen/rmapi/blob/fca802162a412f232a8a35f3a649a543ee3a86ff/api/sync15/blobstorage.go#L48 Looking at https://github.com/juruen/rmapi/blob/fca802162a412f232a8a35f3a649a543ee3a86ff/model/document.go#L67-L72 It seems maybe this would work:

HTTP.request(
    client,
    "POST",
    "https://internal.cloud.remarkable.com/sync/v2/signed-urls/downloads";
    query = Dict(
        "http_method" => "GET",
        "relative_path" => "root",
    )
)

But I get error decoding JSON :/

HTTP/1.1 400 Bad Request
content-type: application/json
rm-token-ttl-hint: 9781
Content-Length: 32
date: Sun, 04 Feb 2024 09:07:49 GMT
server: Google Frontend
traceparent: 00-ac73915d93cbd9b11c3b4f2f0bb9475b-d68255f3e762e126-00
x-cloud-trace-context: ac73915d93cbd9b11c3b4f2f0bb9475b/15457011377136394534
x-envoy-decorator-operation: ingress CreateDownloadUrlV2
Via: 1.1 google
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000

{"error":"error decoding JSON"}