500 o 400 al actualizar el contenido de una publicación usando la API

Estoy intentando actualizar el contenido de una publicación usando la API. La documentación en Discourse API Docs menciona que debo usar PUT /posts/:id.json enviando post[raw] como cuerpo.

Esto resulta en un error 400 junto con:

errors: [ 'param is missing or the value is empty: post' ]

El error se queja de un parámetro llamado post, pero al reemplazar post[raw] por post en mi solicitud HTTP, obtengo una respuesta de error 500 Internal Server Error.

El contenido de la publicación era simplemente Edited comment, así que no creo que tenga nada que ver con el contenido.

¿Me estoy perdiendo algo? ¿Están desactualizados los documentos de la API?

Estoy ejecutando una instancia en la nube en https://forums.balena.io. No estoy seguro de qué versión de Discourse es.

I just realised I was passing a topic id instead of a post id to the API, but the problem still persists. I’m trying to update post 34816, assuming you have access to the cloud instance:

PUT https://forums.balena.io/posts/34816.json

With body:

{
    "post": "Edited comment"
}

And that still results in 500.

Why is my post being flagged as spam? Is this not the right place to submit bugs?

Turns out it works fine if I pass raw instead of post in the request body. The docs could probably be clearer about that :slight_smile:

Glad you got it figured out! I’ve got a bunch of topics that are me taking to myself.

Mostly these are the docs, and they are continually updated: How to reverse engineer the Discourse API :wink:

I generally forget that there are any docs besides just seeing how it works in the browser development tools.