valknight / Cohost.py

A python library for Cohost.org!
MIT License
58 stars 8 forks source link

Notification history API appears to have changed on cohost's end #37

Open lunasorcery opened 8 months ago

lunasorcery commented 8 months ago

EDIT: ignore this, looks like they're rolling out some sorta revamped notification system so let's hold off until that's out fully?

Looks like the /notifications/list endpoint uses the query parameter before with a datetime for pagination now, and offset no longer seems to affect the returned results. I think it's been this way for a while.

Under the new scheme the request looks something like: GET /api/v1/notifications/list?limit=40&before=2024-02-27T12:30:39.968Z

and the API response would look something like:

{
    "comments": {...},
    "posts": {...},
    "projects": {...},
    "notifications": [...],
    "nextBefore": "2024-02-26T23:40:04.858Z"
}

I can have a stab at making the necessary code changes if you'd like? It would mean a minor API break for scripts using the library...

valknight commented 7 months ago

haha, thanks for the big edit at the top :) I'll keep this alive for now to track what's going on with this