Publish posts to discourse using WP plugin throws errror

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?