• Resolved lennydz

    (@lennydz)


    Hi, I’m trying to register new users through the default WP API. However it fails due to some authentication issues. I’m using application password, this used to work few months ago, is there an update somewhere that disabled this?

    Here’s the response I get :

    {"code": "invalid_username","message": "<strong>Erreur :</strong> identifiant inconnu. Vérifiez à nouveau ou essayez avec votre adresse e-mail.","data": {"status": 401}}

    (the message is in french, but it basically says “Error: unknown user. Verify again or try with your email adress)

    my request :

    https://sandbox.lynxws.ch/wp-json/wp/v2/users?username=lennydz&[email protected]&password=12345

    And I deactivated all the plugin for test purpose. And I added the basic auth with username:pwd as it should be. And the I use an admin user.

    Any idea on what’s wrong?

    • This topic was modified 1 year, 1 month ago by lennydz. Reason: add some precision on user role

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    How did you send your request? To create a new user you must use POST method. What username did you use for basic auth? It should be the WP user name you used when you set up the application password, not the application name with which it was created.

    The user field data is normally sent as part of the POST payload data, not as URL query string. I think a query string will still work with POST, but I’ve never tried it that way.

    More information on using application passwords. Scroll down to the Using Credentials / REST API section.

    Thread Starter lennydz

    (@lennydz)

    Ok, I was using the application password’s name as username. Thanks for the answer.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Creating users using API doesn’t work’ is closed to new replies.