API Reference

Users.register

This method registers a new user.

Optionally the user can be activated immediately. If the email parameter contains a string, an email template named by that string will used to send out an activation or welcome email.

The return value is the newly created user id.

This method can only be called with a valid developer key.

Required fields for userData are user and email.

Optional fields are firstname, lastname, password, address1, address2, city, state, country, postal, gender (M or F), birthdate, cellphone, phone, website, occupation, school, language, geo_latitude, geo_longitude and newsletter.

The "user" field must only contain letters (a-z), digits (0-9), underscore (_), hyphen (-), period (.), and the "at" sign (@).

There's also an optional meta field in the userData array. This field can contain any data array.


Syntax

mixed users.register ( mixed vhost, mixed userData, mixed activate = false, mixed sendEmail = false, mixed genCode = false, mixed sendSMS = false, mixed recaptchaToken = false, mixed login = false, mixed token = NULL )

Arguments

NameTypeRequiredDefault valueDescription
vhostmixedRequirednone
userDatamixedRequirednone
activatemixedOptionalfalse
sendEmailmixedOptionalfalse
genCodemixedOptionalfalse
sendSMSmixedOptionalfalse
recaptchaTokenmixedOptionalfalse
loginmixedOptionalfalse
tokenmixedOptionalNULL

Sample Response

Sample REST Response
http://api.newspark.ca/services/rest/users/register?vhost=[VHOST]&userData[user]=[NEW_USER_NAME]&userData[email]=[NEW_USER_EMAIL_ADDRESS]&userData[meta][key]=value&activate=true&APIKEY=[APIKEY]
<?xml version="1.0" encoding="UTF-8"?>
<result>NEW_MEDIA_ID</result>
Sample JSON Response
{
    "status": true,
    "result": NEW_MEDIA_ID
}
Sample REST Response
http://api.newspark.ca/services/rest/users/register?vhost=[VHOST]&userData[user]=[NEW_USER_NAME]&userData[email]=[NEW_USER_EMAIL_ADDRESS]&userData[meta][key]=value&activate=true&APIKEY=[APIKEY]
<?xml version="1.0" encoding="UTF-8"?>
<result>NEW_MEDIA_ID</result>
Sample JSON Response
{
    "status": true,
    "result": NEW_MEDIA_ID
}
Sample REST Response
http://api.newspark.ca/services/rest/users/register?vhost=[VHOST]&userData[user]=[NEW_USER_NAME]&userData[email]=[NEW_USER_EMAIL_ADDRESS]&userData[meta][key]=value&activate=true&APIKEY=[APIKEY]
<?xml version="1.0" encoding="UTF-8"?>
<result>NEW_MEDIA_ID</result>
Sample JSON Response
{
    "status": true,
    "result": NEW_MEDIA_ID
}
Sample REST Response
http://api.newspark.ca/services/rest/users/register?vhost=[VHOST]&userData[user]=[NEW_USER_NAME]&userData[email]=[NEW_USER_EMAIL_ADDRESS]&userData[meta][key]=value&activate=true&APIKEY=[APIKEY]
<?xml version="1.0" encoding="UTF-8"?>
<result>NEW_MEDIA_ID</result>
Sample JSON Response
{
    "status": true,
    "result": NEW_MEDIA_ID
}

Code examples

0 comments

Be the first to comment on register.

Add a Comment

  • captcha