Replying to PM via API not working anymore

I’ve noticed there was a fix to discourse almost a month ago where you can’t create a PM on an existing topic anymore. I never knew this was the issue at all. But it seems this fix “broke” the ability to reply to PM messages through the API.

The response from the discourse server contains the following error: [“Sorry, you can’t create a PM on an existing topic.”].
We are sending the following (example):

url: /posts
json: {
  raw: "message goes here",
  topic_id: 31,
  archetype: "private_message"
}

Can anyone help me fix this issue? Is there another way to reply to PM?
Thank you.

1 Like

Have you checked How to reverse engineer the Discourse API? It’s likely that the API just changed

2 Likes

Replying to topic and private topic is the same through API (you just supply topic_id)… I don’t have any problems with that… It works 100% with latest.

2 Likes

I did some reverse engineering like you suggested. The solution is as followed.

When you reply to an already existing private message archetype must be set to “regular” and not “private_message”.

7 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.