0

Using Kinvey is there a way to autogenerate users (like in this document: http://devcenter.kinvey.com/ios/guides/users#autogenerated) but for REST or AngularJS?

quarks
  • 33,478
  • 73
  • 290
  • 513

1 Answers1

1

Autogenerate users is basically a signup with email, which ends up creating a random username and password.

It is possible to do with any of Kinvey SDKs as well as with REST:

  1. AngularJS

    var promise = $kinvey.User.signup({
      email : '<user-email>'
    });
    promise.then(function(user) {
      alert('Kinvey User signup Success.');
    }, function(err) {
      alert('Kinvey User signup Failed.');
    });
    
  2. REST

POST /user/:appKey/ HTTP/1.1
Host: baas.kinvey.com
Authorization: [Basic Auth with app credentials]
Content-Type: application/json
{"email" : "<user-email>"}

The user email is optional if you don't enforce Email verification in user settings of your Kinvey app.

In that case, you can do a POST request with an empty body i.e. {}.

References:

  1. http://devcenter.kinvey.com/angular/guides/users#signup
  2. http://devcenter.kinvey.com/rest/guides/users#signup
Wani
  • 86
  • 1
  • Thanks for the help can you also support this question: http://stackoverflow.com/questions/35285825/kinvey-rest-api-upload – quarks Feb 09 '16 at 07:04