# Issues with creating a post and locking the topic via the API

**URL:** <https://meta.discourse.org/t/issues-with-creating-a-post-and-locking-the-topic-via-the-api/159003>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [July 28, 2020, 2:55am UTC](https://meta.discourse.org/t/issues-with-creating-a-post-and-locking-the-topic-via-the-api/159003 "2020-07-28T02:55:38Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
**Post date:** [July 31, 2020, 2:06am UTC](https://meta.discourse.org/t/issues-with-creating-a-post-and-locking-the-topic-via-the-api/159003/10 "2020-07-31T02:06:35Z")

</div>

I just tested your code locally and it is working fine for me. What isn’t working? I’m assuming the post is being created, but the topic just isn’t being closed? If so could you use `puts` and output the result of `@client.change_topic_status(slug, topic_id, params)`?

As a side note looking at the code in the api gem we aren’t using the `slug` variable at all, so I’ll make an update to remove it.

---

_[View the full topic](https://meta.discourse.org/t/issues-with-creating-a-post-and-locking-the-topic-via-the-api/159003)._
