# How to mark Topic or Notification as "Read = true"

**URL:** https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730
**Category:** Development
**Tags:** rest-api
**Created:** [February 21, 2019, 7:38am UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730 "2019-02-21T07:38:55Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Edwin\_Mhoy\_Silva](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/edwin_mhoy_silva/32/109980_2.png) [@Edwin\_Mhoy\_Silva](https://meta.discourse.org/u/Edwin_Mhoy_Silva)
#### Post date: [February 21, 2019, 7:38am UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/1 "2019-02-21T07:38:55Z")

</div>

I´m working with the Discourse API.  
The website I’m working on gets all the data from the Discourse API. I’m having the issue that because I’m actually not viewing the Topics and Notification, and only getting data through the api, then my topics and notification are not registered as viewed.

How should I solve this issue?

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [February 21, 2019, 3:36pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/2 "2019-02-21T15:36:55Z")

</div>

If I’m following, you need to make an API call to this endpoint:

> <https://github.com/discourse/discourse/blob/70fdc10365/config/routes.rb#L646>

---

<div class="post-metadata">

### Author: ![Edwin\_Mhoy\_Silva](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/edwin_mhoy_silva/32/109980_2.png) [@Edwin\_Mhoy\_Silva](https://meta.discourse.org/u/Edwin_Mhoy_Silva)
#### Post date: [February 21, 2019, 6:07pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/3 "2019-02-21T18:07:24Z")

</div>

Thanks for the reply.  
How would this post request help me?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 21, 2019, 6:29pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/4 "2019-02-21T18:29:24Z")

</div>

It will mark the posts as “viewed”, which is what you wrote in the first post.

---

<div class="post-metadata">

### Author: ![Edwin\_Mhoy\_Silva](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/edwin_mhoy_silva/32/109980_2.png) [@Edwin\_Mhoy\_Silva](https://meta.discourse.org/u/Edwin_Mhoy_Silva)
#### Post date: [February 21, 2019, 6:31pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/5 "2019-02-21T18:31:53Z")

</div>

> [@joebuhlig](#):
>
> topics/timings

How should the api request look like ?  
something like this?  
{{base\_url}}/t/timings/topic\_Id.json?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [February 21, 2019, 6:37pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/6 "2019-02-21T18:37:14Z")

</div>

> [@Edwin\_Mhoy\_Silva](#):
>
> How should the api request look like ?

Please read [Reverse engineer the Discourse API](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576)

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [February 21, 2019, 6:42pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/7 "2019-02-21T18:42:46Z")

</div>

You could start with following the code back to the controller. Everything you need to know about the method is there.

---

<div class="post-metadata">

### Author: ![Edwin\_Mhoy\_Silva](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/edwin_mhoy_silva/32/109980_2.png) [@Edwin\_Mhoy\_Silva](https://meta.discourse.org/u/Edwin_Mhoy_Silva)
#### Post date: [February 21, 2019, 6:54pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/8 "2019-02-21T18:54:26Z")

</div>

I already tried do the reverse engineering.  
The only response i get from the network tab is  
{{baseurl}} + /t/3295.json?track\_visit=true&forceLoad=true&\_=1550774445459

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [February 21, 2019, 7:01pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/9 "2019-02-21T19:01:02Z")

</div>

You gotta read it carefully.

Right clicking a request to `timings` and selecting copy a cURL will give you all you need for a request using the cURL syntax (the standard format for most people):

```plaintext
curl 'https://meta.discourse.org/topics/timings' \
    -H 'Accept: */*' \
    -H 'Accept-Language: en-US,en;q=0.5' \
    -H 'X-CSRF-Token: LONGTOKENHERE' \
    -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
    -H 'X-SILENCE-LOGGER: true' \
    -H 'Discourse-Logged-In: true' \
    -H 'Discourse-Visible: true' \
    -H 'X-Requested-With: XMLHttpRequest' \
    --data 'timings%5B3%5D=1019&timings%5B4%5D=1019&topic_time=1019&topic_id=108685' \
    --compressed

```

---

<div class="post-metadata">

### Author: ![Edwin\_Mhoy\_Silva](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/edwin_mhoy_silva/32/109980_2.png) [@Edwin\_Mhoy\_Silva](https://meta.discourse.org/u/Edwin_Mhoy_Silva)
#### Post date: [February 21, 2019, 7:37pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/10 "2019-02-21T19:37:27Z")

</div>

This is what I got from the network tab

 ![11](https://global.discourse-cdn.com/meta/original/3X/2/6/26c0e15c45fab246519584ba630aa7246452b090.png)  
What is the the number beside the timings variable?

---

<div class="post-metadata">

### Author: ![ryze1](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@ryze1](https://meta.discourse.org/u/ryze1)
#### Post date: [November 30, 2020, 1:28pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/11 "2020-11-30T13:28:39Z")

</div>

Hi Edwin, did you figure out what this timings variable was an dhow to set it? have same problem.

---

<div class="post-metadata">

### Author: ![natasha\_selvidge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natasha_selvidge/32/235894_2.png) [@natasha\_selvidge](https://meta.discourse.org/u/natasha_selvidge)
#### Post date: [May 25, 2022, 4:38pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/12 "2022-05-25T16:38:35Z")

</div>

Hi Edwin, did you figure out how to get the data? timings and topic\_time? or how to get it work? I have the same issue. Thanks!

---

<div class="post-metadata">

### Author: ![manojm321](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manojm321/32/199669_2.png) [@manojm321](https://meta.discourse.org/u/manojm321)
#### Post date: [March 4, 2023, 5:52pm UTC](https://meta.discourse.org/t/how-to-mark-topic-or-notification-as-read-true/109730/13 "2023-03-04T17:52:13Z")

</div>

can someone please explain what the value of timings and topic\_time are? is that seconds spent on the topic?
