How get thread id from slash commands request?

Hi, I created a custom command and I can’t figure out how to get the thread_id or post_id where I use this command. This information is not included in the body of the request.

I want to create a custom command that will perform integrations with other services, and one of the main identifiers for connecting the service - Mattermost is post_id.

In the body of the request I receive only the fields described in the documentation, but I would like post_id…

Is there anything I can do about this? Perhaps someone has already encountered something similar

If not in the request body try checking context parameters. If not there use Mattermost API to fetch recent posts in the command channel and find the relevant ID. Otherwise you can integrate webhooks for detailed information.