Sto lavorando su questo forum alimentato da Discourse. Dopo che i moderatori mi hanno fornito una chiave API e un nome utente, ho individuato un bug nell’endpoint API POST /posts.json.
Come indicato qui, questo endpoint accetta un topic_id che dovrebbe essere un intero. Tuttavia, quando effettuo una richiesta utilizzando i parametri topic_id e raw in questo modo:
{
"topic_id": 17470,
"raw": "Test post."
}
ricevo il seguente errore:
'You are not permitted to view the requested resource. The API username or key is invalid.'
Ma riesco a creare correttamente il post modificando i dati della richiesta in modo che topic_id sia una stringa.
{
"topic_id": "17470",
"raw": "Test post."
}