Extracting 'last visit' info by using the API

(David Scharf) #1

Is there currently a way to extract the ‘last visit’ marker location (as in, which is the newest post after the last visit) via the API? I have had a look at what I get from hitting the ‘latest.json’ endpoint, and was assuming there might be a way to derive the location of the last visit from there, but I don’t think that info is in there. Or is it? Any help is greatly appreciated on this. Thanks!

PS: In case you’re wondering about the use case, we’re just trying to integrate discourse better into our community page, and want to alert users if there is new content available for them.

(Rafael dos Santos Silva) #2

You need both latest.json and user.json:



Every topic where bumped_at is more recent that the user last_seen_at is above the line.

(David Scharf) #3

Wow, thanks for the fast answer. Sounds good, that’s how I’ll do it then.