Social - Person - Register

/social/person/register

Creates a user based on parameters passed in.  Note there is a GET version of this call that follows the format /social/person/register/user/auth but is deprecated, please use the POST version.

A simple web-based utility is available for managing users.

Authentication

Required, see Auth - Login, must come from ikanow.com website on Saas, or must be admin on deployed version

Arguments

POST.setup (required)
JSON object of a user and authentication following below format

Example

To use these examples: update the fields in the json objects to suit yourself (for example minimally change the fields: firstname, lastname, email, username, password)
These objects are explained in more detail on this page: User creation and updating JSON object formats

SetupJSON
 SetupJSON = 
{ 
	"user": 
		{
			"created":"Oct 21, 2011 14:13:08 PM","modified":"Oct 21, 2011 14:13:08 PM","firstname":"jill","lastname":"smith","phone":"5555555555","email":["jillsmith@ikanow.com"]
		},
	"auth":
		{
			"password":"SHA256_HASHED_PASSWORD","accountType":"user","created":"Oct 21, 2011 14:13:08 PM","modified":"Oct 21, 2011 14:13:08 PM"
		} 
}

Dates must follow the format: MMM dd, yyyy kk:mm:ss aa as specified via java SimpleDateFormat: http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html

Passwords must be hashed by SHA256 into base64 (most websites hash to HEX).

http://insidepro.com/hashes.php?lang=eng#1 will perform many hashes, the 2nd SHA256 is the base64 hashed password we require.

You can use a site like: http://meyerweb.com/eric/tools/dencoder/ to encode your JSON objects before adding them to the url

Method.Post

 


curl \-XPOST 'http://infinite.ikanow.com/api/social/person/register' \-d '{ "user": {"created":"Oct 21, 2011 14:13:08 PM","modified":"Oct 21, 2011 14:13:08 PM","firstname":"jill","lastname":"smith","phone":"5555555555","email":["jillsmith@ikanow.com"]},"auth":{"username":"jillsmith@ikanow.com","password":"SHA256_HASHED_PASSWORD","accountType":"user","created":"Oct 21, 2011 14:13:08 PM","modified":"Oct 21, 2011 14:13:08 PM"}}'


 

Example Response
{
    response: {
        action: "WP Register User"
        success: true
        message: "User Registered Successfully"
        time: 10
    }
}

Common Error Messages:
  • Need to specify email: the user object is required to have email field populated.
  • Need to specify one of firstname,lastname: the user object is required to have the first and last name fields populated
  • User already exists, either WPUserId or first email: Either the email address or the wordpress ID field you submitted have already been used.
  • Need to specify password:the authentication object requires the password be set
  • error while saving objects: this is a general error for any other failing.