# Getting Post ID with Topic ID - API Help Needed

**URL:** <https://meta.discourse.org/t/getting-post-id-with-topic-id-api-help-needed/44239>\
**Category:** Development\
**Created:** [14 במאי,‏ 2016,‏ 1:20pm UTC](https://meta.discourse.org/t/getting-post-id-with-topic-id-api-help-needed/44239 "2016-05-14T13:20:31Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![P16](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@P16](https://meta.discourse.org/u/P16)\
**Post date:** [14 במאי,‏ 2016,‏ 1:20pm UTC](https://meta.discourse.org/t/getting-post-id-with-topic-id-api-help-needed/44239/1 "2016-05-14T13:20:31Z")

</div>

Hi Everyone,

We are setting up a new Discourse forum and needed some help with the API.

One of the changes we are making is that we show the first post in a topic on the topic page (like Topic Preview). Since most posts will be visual, we show the image, the title, the replies and likes, etc of the topic to the user. Something like this:

 ![](https://global.discourse-cdn.com/meta/original/3X/3/4/34b1c4245201cf670720f0d1f792b0005c47b628.png)

We wanted the user to be able to like the first post in the topic by clicking on the heart icon from the main page. How can we get the first post id of a topic from the main page since we only have the topic id?

Also, once we get the post id, we need to send that and the post action type id as 2 to [http://DiscourseURL/post\_actions](http://DiscourseURL/post_actions)  
Is that correct?

Thanks!

---

_[View the full topic](https://meta.discourse.org/t/getting-post-id-with-topic-id-api-help-needed/44239)._
