register
This endpoint allows user registration. To disable registration email notification to user:
http://localhost/api/user/register/?key=KEY-HERE &username=john &email=john@domain.com&nonce=8bdfeb4e16& display_name=John&user_pass=8734tHYS¬ify=no
Please make sure you provide valid values that these fields expect in correct format.
To register user with a reference
Provide the ‘reference’ variable with the call. You can then use the get_user_meta endpoint to get the value. meta_key=reference.
http://localhost/api/user/register/?key=KEY-HERE &username=john &email=john@domain.com&nonce=8bdfeb4e16& display_name=John&user_pass=8734tHYS&reference=app
Screenshot of Postman
Resource URL
http://localhost/api/userplus/register/
Method
POST
Required Parameters
- username
- nonce – you can disable it from Settings > User Plus
- display_name
- key – get API key from Settings > User Plus
Optional Parameters
- user_pass – for setting custom password
- custom_fields – user meta array with meta_key as index and meta_value as its value.
- notify – send ‘no’ value to disable registration notification to user
- bp – to register BuddyPress user with activation email, use bp=1
- reference – to distinguish user for any reference, i.e. website, app, or via other user etc
- role – for setting any valid available user role, 'admin' role is not available; you must enable first this option from Settings > UserPlus
Sample Request URL
http://localhost/api/userplus/register/?key=KEY-HERE &username=john&email=john@domain.com&nonce=8bdfeb4e16&display_name=John
“error”: “Invalid access, unverifiable ‘nonce’ value. Use the ‘get_nonce’ Core API method. “,
“status”: “error”,
got this error in flutter dont know how to verify nonce could you please help me out.
You can get nonce by calling get_nonce method and then providing controller and method. like this >>
/api/get_nonce/?controller=user&method=register
Object {
“error”: “Invalid access, unverifiable ‘nonce’ value. Use the ‘get_nonce’ Core API method. “,
“status”: “error”,
}
everytime i send call its return unverifiable ‘nonce’ value in react native , but everything is correct , and call work whenrender it directly into url
Make sure you don’t have any caching plugin enabled, that might be stopping get_nonce.
Also, WordPress default sessions sometimes don’t work well with certain hosts. There’s two main ways to set your site to have more reliable sessions with so try:
Set this in your wp-config.php file:
define( 'GIVE_USE_PHP_SESSIONS' , false);