Calling POST on /posts.json returns null

AI-generated summary

The discussion revolves around the issue of calling the POST on /posts.json endpoint returning null in Discourse 2.2.0. JakeFromStateFarm is experiencing this issue when posting valid data with custom settings for approve post count and approve unless trust level. He expects the API to return a response with an ID, even if the post is under review. In response, sam questions the validity of the issue, sharing his own experience of receiving a payload after posting. He suggests the possibility of an edge case if the post hits the queue and recommends using the guide to reverse-engineer the Discourse API to troubleshoot the issue.

I’m trying to create a new post using the API (Discourse 2.2.0). In the settings, approve post count is set to 3 and approve unless trust level is set to 1: basic user.

When posting valid data, the response is an HTTP 200, but the response is null.

If approve post count and approve unless trust level are default values, the API returns JSON for the response.

We use the response to map a discourse topic/post to a record within our system. Naturally, we can’t make this linkage if we don’t receive back an id in the response.

Is this what the API is supposed to do? Why not send back a response and a status letting the API’s client know that the post/topic is under review?

Are you 100% sure this is returning nothing?

When I posted this post I got:

And we are explicit about returning stuff here:

There may be some edge case though if your post hits the queue, but I am pretty sure it should return a payload.

Can you try: Reverse engineer the Discourse API