Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I keep getting Error 401 #33

Open
unbrother opened this issue Feb 24, 2022 · 10 comments
Open

I keep getting Error 401 #33

unbrother opened this issue Feb 24, 2022 · 10 comments

Comments

@unbrother
Copy link

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.

@maelle
Copy link
Collaborator

maelle commented Feb 24, 2022

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?

@henrywangnl
Copy link
Contributor

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

@unbrother
Copy link
Author

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).

@nordicai
Copy link

nordicai commented Apr 3, 2022

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.

@maelle
Copy link
Collaborator

maelle commented Apr 4, 2022

@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).

@Dennishi0925
Copy link

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
Copy link

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

@Lextuga007
Copy link

Lextuga007 commented Mar 31, 2023

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.

@maelle
Copy link
Collaborator

maelle commented Apr 4, 2023

@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. 😅

@Lextuga007
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants