`liked` field in Latest.json is always null even when a post is Liked

I tried using the below API to like a post:

POST : baseUrl/post_actions
Body - {"id": 123,"post_action_type_id": 2,"flag_topic": false}

When I call latest.json, the response has liked: null for the post which is liked.

When I like the same post from Discourse Web UI, I am able to get liked: true in latest.json.

Am I missing something in the above LIKE API that I am using? I just tried to replicate the API called from Discourse Web UI.

2 Likes

Are you requesting the /latest.json as an authenticated user with the auth headers?

Are you liking the OP ?

4 Likes

Yes I am requesting /latest.json as an authenticated user with auth headers