Publish posts to discourse using WP plugin throws errror

AI-generated summary

cyriac15 reports an issue with the Discourse WordPress plugin where publishing posts from the WordPress admin panel fails with the error: “You are not permitted to view the requested resource. The API username or key is invalid…”. The user notes that the plugin previously worked correctly. Despite verifying that the API settings, username, and key are correct, the error persists when submitting from WP. To troubleshoot, cyriac15 tested the API credentials using a cURL request in Postman, which successfully returned a 200 status code, confirming that the credentials themselves are valid. The user suspects that a recent PHP version upgrade might be the cause of the disruption, although this is unconfirmed. They are seeking assistance to resolve the publishing error.

Hi,
I am using discourse WordPress plugin and it was working fine. I was able to publish posts from WP admin. Currently what happens is like when I Publish the post it throws error
There has been an error publishing your post: You are not permitted to view the requested resource. The API username or key is invalid…

I checked the API settings and username and it was fine. In order to confirm the configuration I tried curl request in postman and it returned 200 status.
Can someone help me on this?

Few days back I had upgraded the PHP version. Not sure if this has any impact on that.

The API key and username is working fine when tested with Postmam. But when submitting from WP admin its throwing error
There has been an error publishing your post: You are not permitted to view the requested resource. The API username or key is invalid..

Can someone help me on this?