• Resolved griego62

    (@griego62)


    I am trying to register users on my WordPress site through Postman using Basic Auth and form-data method with username, email and password keys and their corresponding values. I have selected the POST request and this is my URL structure: website/wp-json/wp/v2/users. I am using the JSON API. Unfortunately, the return is { "status": "ok", "json_api_version": "2.3.0", "controllers": [ "users", "core" ] but the user is never registered. Can somebody please tell me what I’m doing wrong?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The feedback is wrong. I suspect you are doing something wrong in your request, possibly in the form-data specifications. Or you have a plugin in use that makes changes at this point. In my test just now in a plugin-free WordPress installation, creating it the way you described worked without any problems.

    Thread Starter griego62

    (@griego62)

    Thank you for your reply @threadi !
    Unfortunately, I had no luck. I deactivated all plugins, yet I was unable to create a user. These are my form-data specifications. I also recreated my .htaccess but to no avail. Is there anything else I can try?

    • This reply was modified 2 years, 9 months ago by griego62.

    Just had a look where “json_api_version” comes from. It is not present in the wordpress core: https://github.com/WordPress/WordPress/search?q=json_api_version&type=code

    So this return must come from something else that you are using.

    As a hint: you have to create a REST API password for the user you are logging in with. You can find this under “Edit Profile” at the bottom. You may have already done this, otherwise you would get a different error message.

    Thread Starter griego62

    (@griego62)

    @threadi the json api version the response shows is that of the JSON API plugin installed on my WP site. How could I do the request without using it?

    I didn’t really understand your comment about the REST API password. Are you referring to the authorization?

    You do not need an extra plugin for it. Deactivate it and set your application password (it will be generated) in your user profile as described. You can than login via REST API with your username and the generated password. More about it: https://make.www.ads-software.com/core/2020/11/05/application-passwords-integration-guide/

    Thread Starter griego62

    (@griego62)

    Thank you, @threadi !
    I have been able to create a user eliminating the JSON API and following the instructions in the link you provided. Not that difficult in the end. I got diverted by using the plugin. I appreciate your time and patience.
    Cheers!

    Glad I could help. Sometimes there are things that can be solved much easier ?? You are welcome to set the topic to solved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Create users using WP REST API’ is closed to new replies.