Wordpress / discourse integration not connecting

I’m struggling to get wordpress to connect to discourse (my install is here forum.employ.com), here is my error message:

[2023-11-07 19:14:56] connection.INFO: check_connection_status.failed_to_connect {"error":"wpdc_response_error","message":"An invalid response was returned from Discourse","http_code":403,"http_body":"{\"errors\":[\"You are not permitted to view the requested resource. The API username or key is invalid.\"],\"error_type\":\"invalid_access\"}"} 
[2023-11-07 19:15:11] connection.INFO: check_connection_status.failed_to_connect {"error":"wpdc_response_error","message":"An invalid response was returned from Discourse","http_code":403,"http_body":"{\"errors\":[\"You are not permitted to view the requested resource. The API username or key is invalid.\"],\"error_type\":\"invalid_access\"}"} 
[2023-11-07 19:15:35] connection.INFO: check_connection_status.failed_to_connect {"error":"wpdc_response_error","message":"An invalid response was returned from Discourse","http_code":403,"http_body":"{\"errors\":[\"You are not permitted to view the requested resource. The API username or key is invalid.\"],\"error_type\":\"invalid_access\"}"} 
[2023-11-07 19:16:18] connection.INFO: check_connection_status.failed_to_connect {"error":"wpdc_response_error","message":"An invalid response was returned from Discourse","http_code":403,"http_body":"{\"errors\":[\"You are not permitted to view the requested resource. The API username or key is invalid.\"],\"error_type\":\"invalid_access\"}"} 
[2023-11-07 19:16:51] connection.INFO: check_connection_status.failed_to_connect {"error":"wpdc_response_error","message":"An invalid response was returned from Discourse","http_code":403,"http_body":"{\"errors\":[\"You are not permitted to view the requested resource. The API username or key is invalid.\"],\"error_type\":\"invalid_access\"}"} 
[2023-11-07 19:55:28] connection.INFO: check_connection_status.failed_to_connect {"error":"wpdc_response_error","message":"An invalid response was returned from Discourse","http_code":403,"http_body":"{\"errors\":[\"You are not permitted to view the requested resource. The API username or key is invalid.\"],\"error_type\":\"invalid_access\"}"} 
[2023-11-07 19:57:56] connection.INFO: check_connection_status.failed_to_connect {"error":"wpdc_response_error","message":"An invalid response was returned from Discourse","http_code":403,"http_body":"{\"errors\":[\"You are not permitted to view the requested resource. The API username or key is invalid.\"],\"error_type\":\"invalid_access\"}"} 

I have the key created correctly, so not really sure what’s next…any ideas?

  • Jake

How did you create the API username and key? User Level and Scope.
From the documentation:

  • The username should be a Discourse admin user.
  • The scope should be set on Global

Can you confirm you are doing right?

2 Likes


I believe we have done things correctly with the setup.

Employ Concierge

That’s your issue! You should enter the username, not the name.
An username is unique, with no spaces.

2 Likes

Tried that will try it again now, you’re saying it can only be one word correct, the username?

Yes, you can look at that user’s profile on your Discourse. You have the username displayed (or you can look at the URL too).

E.g.:

Okay, so I don’twant to use my name…I guess I have to create another admin in discourse with a more generic name then correct?

Sure, you can create another admin user. :slight_smile:

1 Like

As @Arkshine has noted, the Publishing Username needs to be set to an admin user’s username, not to their full name.

You haven’t posted your full API Key here, but you need to be very careful about posting anything that contains API Keys from your Discourse site. If it was my site, I’d probably generate a new API Key now and update the API Key setting on WordPress to use the new key.

@angus, would it be worth blocking out the value of the API Key setting in the plugin’s UI? Doing that might highlight the fact that the key needs to be protected. It would also make it easier to post screenshots of the plugin’s Connection status page.

3 Likes

Thanks Simon, yeah I created another one, so no problem there.

It would be helpful if in the documentation in the discourse plugin it was more clear about the discourse username, probably many people try this and give up, don’t bother coming over here to ask. You could give an example of the url and how to find it…like was done in this thread.

2 Likes

Glad you got it sorted @Jacob_Peebles.

As mentioned in the connection video and documentation, the simplest course of action is to just leave the username as the default system.

If you choose to change this, you do need to use another username.

I’ve added an extra line to the documentation about where to find a user’s username.