• Resolved aaron@rossano.com.au

    (@aaronrossanocomau)


    I’m running WP 4.4, WP OAuth Server with WP Rest API v2.
    I managed to authenticate using the admin user (using a test local site with a self signed SSL certificate).

    But when I try to create new user I get the following:
    {“code”:”rest_cannot_create_user”,”message”:”Sorry, you are not allowed to create users.”,”data”:{“status”:401}}

    URL: https://dev.wp1.com/wp-json/wp/v2/users/
    Method: Post
    Content type: application/x-www-form-urlencoded
    Data: email=test1%domain.com&username=test1&password=test1

    I checked with Members plugin and all privileges are set for the admin user / group.

    https://wordpress.org/plugins/rest-api/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    To confirm, you’re using the latest version of the API, Beta 9?

    {“code”:”rest_cannot_create_user”,”message”:”Sorry, you are not allowed to create users.”,”data”:{“status”:401}}

    A 401 status code means the request isn’t authenticated. It’s hard to say why WordPress thinks the request isn’t authenticated when you think it is, but I would start there first.

    Thread Starter aaron@rossano.com.au

    (@aaronrossanocomau)

    I was using API Beta 9.
    I stopped using it and switched over to API JSON User with a prebuilt solution I had found. I’ll try again next time I start a new project, hopefully I get it working next time. Thank you for the response.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Unable to create new user through Rest API’ is closed to new replies.