accounts.initRegistration REST

Skip to end of metadata
Go to start of metadata

 

This method initializes a registration process at a site. To fully register a user to your site requires three API calls:

  1. accounts.initRegistration
  2. accounts.register
  3. accounts.finalizeRegistration


The method returns a  regToken  (registration token) in the response, which is required when calling accounts.registeraccounts.finalizeRegistrationaccounts.linkAccounts

For registration through a social network, see accounts.socialLogin.

For registration of lite accounts, see below

 

Note: If you plan on integrating Gigya's Accounts API, we highly recommend reading the Registration-as-a-Service Guide. Registration-as-a-Service (RaaS) is a premium platform that requires separate activation. If RaaS is not part of your site package, please contact Gigya by filling in a support form through the Console. You can access the support page by clicking Support on the upper menu after logging into the Gigya Console.

Request URL

Where <Data_Center> is:
  • us1.gigya.com - For the US data center.
  • eu1.gigya.com - For the European data center.
  • au1.gigya.com - For the Australian data center.
  • ru1.gigya.com - For the Russian data center.
  • cn1.gigya-api.cn - For the Chinese data center.

If you are not sure of your site's data center, see Finding Your Data Center.

Parameters

RequiredNameTypeDescription
isLiteBoolean

Defines whether the regToken that is returned can be used to create a full registered account or a lite account.  

Set this to TRUE to create a lite account.

             
format string Determines the format of the response. The options are:
  • json (default)
  • jsonp - If the format is jsonp then you are required to define a callback method (see parameter below).
callback string This parameter is required only when the format parameter is set to jsonp (see above). In such cases this parameter should define the name of the callback method to be called in the response, along with the jsonp response data.
httpStatusCodes Boolean The default value of this parameter is false, which means that the HTTP status code in Gigya's response is always 200 (OK), even if an error occurs. The error code and message is given within the response data (see below). If this parameter is set to true, the HTTP status code in Gigya's response would reflect an error, if one occurs.

Authorization Parameters

Each REST API request must contain identification and authorization parameters.

Please refer to the Authorization Parameters section for details. 

Response Data

FieldTypeDescription
 
statusCode integer The HTTP response code of the operation. Code '200' indicates success.
errorCode integer The result code of the operation. Code '0' indicates success, any other number indicates failure. For a complete list of error codes, see the Error Codes table.
statusReason string A brief explanation of the status code.
errorMessage string A short textual description of an error, associated with the errorCode, for logging purposes. This field will appear in the response only in case of an error.
errorDetails string This field will appear in the response only in case of an error and will contain the exception info, if available.
fullEventName string The full name of the event that triggered the response. This is an internally used parameter and not always returned.
callId string Unique identifier of the transaction, for debugging purposes.
time string The time of the response represented in ISO 8601 format, i.e., yyyy-mm-dd-Thh:MM:ss.SSSZ or

 

 

regTokenstringA ticket that is used to complete the registration process if registration fails. Valid for one hour.

A field that does not contain data will not appear in the response.

 

Response Example

Full Registered Account

{
  "regToken": "RT1_dBFII5RbVxUc8nBdc3bMDT7hmmrIvgen1wCG_dxqadJhAAWkNZSIhV-1DGKZvwZ0-DQUg5JS8Y61ukrjwOp8p81S9pP6R_BhovjemyHtbA0dAsx-PMuL2zIosIac-rUvj3lTh1WL6rg0IY1bFO3pdrgQvxN_Pxa0r6kxTb5QiZNn7ojd-SXYnLUgrW6iw-OIzAzp8hZBMN_hpwEauylxTfJM_9nGpnT_QxLnoKTAEvzIhK-yFU9PJlT_RA7tJzjahTxqRxU3Qd3KsYtAu-K5wRoRNGpVMTWQbKoe6lIeSKnF6lFNeozDiuv1Vat6c9qE8RVOhp8leM9NAWG_3937L2MchFEFbBNqsgKk0QZ8Ow_SG03SS2RhQpq8KhG28A-47i1PXY041LHP_J8NwtUI8u0_ObVDsIInv3h33aKPQN1BxY4DxICSXtS8iuL7dsgG2T0KuegagIoYiNhLbnSeowkRRkZ-wiiKJOTupKGw7w6bmjqwBhqGWo9cudKLMFT22lsZ3oqah3SXizOi8NKP6g..",
  "statusCode": 200,
  "errorCode": 0,
  "statusReason": "OK",
  "callId": "5d18ece8a76f422e917bbbf094c5cf11",
  "time": "2015-03-22T11:42:25.943Z"
}

 

Lite Account

Note the _LTE_ in the regToken which designates this as a lite account regToken.

{
  "regToken": "RT1_LTE_stD2lH~02045353544b083130313130303935016f60~oAFTqSaZcw_2RPXm4lpl0yriKB_06gy8Vgt2VTBw0HY-2rJdVq5DcPiDdIfxUanHJ-1C0g_gXzJgprkjbM46QduXtvYZRvoHMNig9bCRXD7ycX4a_-p9U6j4XmtyucHMvcYqjLAP6yVo7rWYlGqUocZn0ml2j42pjsY_bJ6t1TRMwcT0EHiPMb9gf_2nkd7T-ECVS7Fmvi9h2NYPuNY5zooWEGVVGwXYpNj-ENd2bvFeNtY~",
  "statusCode": 200,
  "errorCode": 0,
  "statusReason": "OK",
  "callId": "6ceb78164ac34ae9b5222b96026e9ec9",
  "time": "2017-06-07T09:44:24.621Z"
}

 

Lite Account Subscription Flow

Lite Registration and Subscription Management are premium platforms that require separate activation. For inquiries, contact your Account Manager by filling a support form. You can access the support page by clicking Support on the upper menu after logging into your Gigya Console.

Lite accounts differ from full registered accounts in several important ways.

  • Lite accounts do not contain a UID.
  • Lite accounts are NOT registered accounts.
  • Lite account users are not able to login to your site.
  • Lite accounts support additional limited functionality compared to full accounts.
  • The only two APIs required to create a lite account are:

You do not use accounts.register or accounts.finalizeRegistration in a lite account flow.To learn more about Lite Accounts, see the Lite Registration documentation.

The following will demonstrate how you can register a user's email address to a lite account using Gigya's web SDK.

1.    If not using Screen-Sets, you will need to collect some basic information from the user. The minimum data required is an email address.

2.    If necessary, ensure that you defined the necessary subscription in your site's schema. This can be done using either the Screen-Sets UI Builder or the accounts.setSchema API.

3.   After the user confirms they would like to subscribe to your site/newsletter/etc., call accounts.initRegistration and pass isLite: true so the API recognizes that this is not for a full registration, and also a callback so you can retrieve the user's regToken which you will need in the next step.

gigya.accounts.initRegistration({ isLite: true, callback: liteRegistrationCallback });

4.   In the callback, call accounts.setAccountInfo and pass the following minimum parameters:

  • regToken (required - The regToken you received from accounts.initRegistration)
  • profile (required - If you have any profile data to associate with this user, i.e., profile.firstName, profile.lastName, etc. At a minimum you must pass an email address.)
  • subscriptions (optional - This must be an active subscription pre-defined in your site's schema. You can create lite accounts that do not have a subscription.)

A code example of the entire process follows, see Subscriptions Object REST for a full description of the subscription object:

 

JS Code Example

function liteRegistrationCallback(res) {
    var myToken,myEmail,myProfile,callParams;
    myToken = res.regToken;
    myEmail = "The user's email address";
    myProfile = {
        "email" : myEmail
        //, any additional profile data collected, i.e., firstName
    }
    callParams = {
        "regToken": myToken,
        "profile": myProfile,
        "subscriptions": {
            "jun4th":{ // This MUST be active and predefined in your site's schema or setAccountInfo will fail!
                "email":{
                    "isSubscribed":true, // This tells whether the user is actually subscribed to the subscription, this can be false if the user registers but does not want to receive the newsletter.
                    "tags":[
                        // Any tags you want to associate with this user.
                        // The tags property should be removed if you are not setting tags or any existing data will be deleted.
                    ]
                }
            }
        }
    };
    gigya.accounts.setAccountInfo(callParams);
}
function liteRegStart() {
    gigya.accounts.initRegistration({
        isLite: true,
        callback: function(res) {
            liteRegistrationCallback(res);
        }
    });
}

 


5.   Once the call completes the user will have a new lite account on your site. You can then query this and other lite accounts on your site using the accounts.search API or view them from the Identity Access page of the Gigya Console.


Response Example Using The isLite Parameter

// Note the regToken contains _LTE_ which designates this is a lite account regToken
{
    callId:"03fd1c9716344d31a544b6d4bb3cd35e"
    context:undefined
    errorCode:0
    errorMessage:""
    operation:"/accounts.initRegistration"
	regToken:"RT1_LTE_stDr2E~02045353544b083130313130303935016f60~oAEk4oE7G7VrrWp63cR7RwFMMPOrdN6hxvDolvyxr5Wsc26ucN1K_HLiwqqKHz4v5gypt4DhaTmemcwxk1JBwZB7IlPN7nv8bXUFJfav684VSK9_R0-3_CfWGIYR7PwltuGsQKJUzEQnb-nhz-BPQ75XpGbh84GkWnhL537dEhLBe01t3xmJSkvuS6H5vwYKfahp9xHdkeJGCi4bVIip2OhgEGeAGBG83iRKI8zpKvm6FwM~"
    requestParams:Object
    status:"OK"
    statusMessage:""
    time:"2017-06-08T14:26:27.097Z"
}

 

Additional Information

For configuring a screen-set to support lite account creation, see our Lite Registration Quick Start Guide.