Antes de tentar isso, isso significa, ou bem… o que isso significa?
Isso significa: {post: {raw: ..., raw_old: ... }}
Ou simplesmente {raw: "", raw_old: ""...}
E também, o que é raw_old? Só diz que cada elemento é uma “string” do que devo enviar (PUT) no corpo JSON.
Estou apenas tentando adicionar uma linha no topo da postagem (que foi criada inicialmente por um Bot), onde precisamos adicionar um link para outro site. Note também que, com o objetivo de ter esse primeiro parágrafo exibido abaixo do título da Categoria, ou no elemento cooked
a ser mostrado (definido logo abaixo do título da categoria).
Espero que isso faça sentido. Se não, peça para eu esclarecer.
I’m not actually sure what raw_old is for at the moment, but you just need to use the raw field and it will replace the entire post. So, in your code you would fetch the post you want to edit, add your line to the top, then update the post using the raw field.
It might be helpful to see how Discourse does it by editing a post live on your site and inspecting the browser calls:
Just a question on this, are you referring to different documentation then what is defined at Discourse API Docs ? That would be interesting… however I am only going by the API docs.
My simple goal is to simply add a comment + link below the category name, which I think Discourse takes from the first Post of the "About … " topic? Like I’m just looking for what it will insert into the
… element or what I need to do to make my post appear there. Does my explanation make sense?
From the above, and from attempting, you can not update a post using “cooked” as the API documentation states, it is however possible with “raw”, all attempts I made using “cooked” kept giving me back an error that my post was invalid as it was under 20 characters, or not a clear sentence …
However there are additional issues with “raw” that I will make into another post as this isn’t directly related.
Yes, thanks, I realized this after attempting a few Postman requests and playing around with it… also in my attempts, the “cooked” seemed to do nothing… and I’m still not sure what “raw_old” is.