Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

401 error on calling list_items #23

Open
supertrianguloid opened this issue Jul 9, 2022 · 9 comments
Open

401 error on calling list_items #23

supertrianguloid opened this issue Jul 9, 2022 · 9 comments

Comments

@supertrianguloid
Copy link

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
Copy link
Owner

theogf commented Jul 17, 2022

Thanks! I am looking into this right now!

@theogf
Copy link
Owner

theogf commented Jul 17, 2022

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
Copy link

Amval commented Oct 15, 2022

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: juruen/rmapi@6116680

@blegat
Copy link
Contributor

blegat commented Feb 2, 2024

Luckily some good people figured out the new links and calls

It seems to be using this link

const SERVICE_DISCOVERY_API = "https://service-manager-production-dot-remarkable-production.appspot.com"

with
const ITEM_LIST = "/document-storage/json/2/docs"

It seems the other projects didn't change this link recently, did you find any ?

@theogf
Copy link
Owner

theogf commented Feb 2, 2024

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
Copy link
Contributor

blegat commented Feb 3, 2024

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
Copy link
Contributor

blegat commented Feb 4, 2024

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"}

@caleb-allen
Copy link

@blegat do you happen to still have the files from your attempt on hand? if you put a PR draft up I'd be interested in picking up where you left off

@blegat
Copy link
Contributor

blegat commented Oct 23, 2024

@caleb-allen Thanks, I pushed my local changes to https://github.com/blegat/Remarkable.jl/tree/debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants