Create User

Usage

Use this method to create a user through the Messenger API.

client.createUser(data).then(function(result){

});

Mandatory parameters

Name Type Description
name string The name of the user to be created
address string The address of the user to be created

Optional parameters

Name Type Description
extra array A list of extra user attribute values to be registered for the user, according to the attributes defined in the instance's Messenger > Settings > User data screen of the Messenger instance
id integer The ID of the extra user attribute as defined in the instance
content string The value corresponding to the specified attribute ID

Response data format

The createUser method returns the ID of the created user. For the full response model, please see the Responses section for the POST /users endpoint on the Messenger API Routes page

Example

client.createUser({ 
    address:'<email_address>', 
    extra:[], 
    name:'<name>' 
}).then(function(result){ 
console.log(result); 
});