goodpress icon indicating copy to clipboard operation
goodpress copied to clipboard

I keep getting Error 401

Open unbrother opened this issue 3 years ago • 10 comments

I am not sure if this is the right place to post this issue, but since Wordpress is not using the authorization plugin and it has been integrated inside, I believe this is what causes me an error showing that I am unauthorized with code 401. I am not sure if this is due to my credentials being wrong or something else. I have checked everything there is online but information is scarce, at least for this error.

unbrother avatar Feb 24 '22 00:02 unbrother

Ah you mean you use a newer version of Wordpress stuff? I haven't used goodpress in a long time so can't help. @henrywangnl do you happen to have any insight?

maelle avatar Feb 24 '22 07:02 maelle

Hmm, it's still working well for me as I just tested it. My WordPress is the latest: v5.9.2

henrywangnl avatar Mar 13 '22 20:03 henrywangnl

I also have v5.9.2. Updated everything, talked to my hosting provider. Now I am getting bad request 400. Exact error is

Error in wp_call_api(VERB = "POST", api_url = api_url, body = post) : 
  Bad Request (HTTP 400).

unbrother avatar Mar 20 '22 06:03 unbrother

I had the same problem (HTTP 400). I did some debugging and found that REST-API require the date to have the format YYYY-MM-DDTHH:MM:SS. This is controlled by the "date" field in the index.Rmd. You can remove it and WP will assume the time when it was posted. Or you define your own as long as it follows the above mentioned format.
date: "r Sys.Date()" does not work for me as well.

nordicai avatar Apr 03 '22 12:04 nordicai

@nordicai thanks for the digging! If you want, you can make a PR to improve docs/templates in this repository (and add yourself as ctb to DESCRIPTION in that case).

maelle avatar Apr 04 '22 07:04 maelle

Also got the error code: Error in wp_call_api(VERB = "GET", api_url = api_url) : Unauthorized (HTTP 401). Have checked the application password, the Rmd/md file, and the .htaccess file. Did anyone encounter the problem and get it solved?

Dennishi0925 avatar Dec 02 '22 12:12 Dennishi0925

update: I switched to the MAC OS from Windows and didn't meet the problem below

Dennishi0925 avatar Dec 04 '22 15:12 Dennishi0925

I have the same problem but I don't have access to a MAC 😞 I wonder if it's the date format which occurs if I write "2019-03-07T01:01:00" or remove it altogether.

Lextuga007 avatar Mar 31 '23 17:03 Lextuga007

@Lextuga007 you mean that whatever you do to the date, it doesn't work?

What OS are you on? Hoping someone has experience with it and goodpress. :sweat_smile:

maelle avatar Apr 04 '23 09:04 maelle

There is a strong possibility that the problem is because I'd missed the step where the WordPress add in is needed! It's for a managed page so I didn't do it just in case but I haven't given up and I'll give it another go on a couple of weeks!

Lextuga007 avatar Apr 04 '23 19:04 Lextuga007