Comment marquer un sujet ou une notification comme « Read = true »

Je travaille avec l’API Discourse.
Le site sur lequel je travaille récupère toutes les données via l’API Discourse. Je rencontre un problème : comme je ne consulte pas réellement les sujets et les notifications, et que j’obtiens uniquement les données par l’API, mes sujets et notifications ne sont pas marqués comme consultés.

Comment puis-je résoudre ce problème ?

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

3 « J'aime »

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

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

How should the api request look like ?
something like this?
{{base_url}}/t/timings/topic_Id.json?

Please read Reverse engineer the Discourse API

4 « J'aime »

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

1 « J'aime »

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

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):

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
6 « J'aime »

This is what I got from the network tab


What is the the number beside the timings variable?

Salut Edwin, as-tu compris ce qu’était cette variable timings et comment la définir ? J’ai le même problème.

Salut Edwin, as-tu trouvé comment obtenir les données ? les horaires et topic_time ? ou comment le faire fonctionner ? J’ai le même problème. Merci !

quelqu’un peut-il m’expliquer la valeur de timings et de topic_time ? s’agit-il de secondes passées sur le sujet ?