socialize.importIdentities REST

Skip to end of metadata
Go to start of metadata

Unable to render {include} The included page could not be found.

This method enables you to import a social user into Gigya. 

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
UIDstringA unique identifier for the imported user. Gigya verifies that this UID does not already exist. 
identitiesarray of objectsAn array of Identity objects. The two most common fields are:
  • provider - the name of the provider for this identity, e.g. "facebook", "twitter", etc.
  • providerUID - the ID of the user on the specified provider.

For a comprehensive listing of all available fields, refer to the Identity object.

handleIdentityConflictsstringDefines what to do in case a provided identity is already linked to another UID for the same Site ID. 
The possible values are: 
  • Error (default) - returns an error in case any of the provided identities conflict with an existing user. 
  • Ignore - ignores the conflicted identity, meaning it will not be added to the requested UID.
  • Connect - the conflicting identity will be added to the user as a connection, but will not allow login (i.e., a connected identity will be created without a linked login).
allowNewUserBooleanWhen set to true, a new user will be created if the UID does not exist. When set to false, the UID must already exist. The default value is false.
providerSessionsJSON object

This parameter gives the option to pass to Gigya, session information obtained directly from a social network, so it can be used for making API calls to the social network. The value of this parameter is a JSON object with reference to other objects. The field names of the main object are the names of the provider to set the session information for. The sub-objects contain the session information.

For example:

{ 
      "facebook" : { "authToken" : "9187391837918237" },
      "yahoo" : { "authToken" : "kjhd0ukjhuwd", tokenSecret : "aALJSIjlSyug", 
           tokenExpiration: "123890983" }
 } 

Note: Each provider requires a different set of fields for making API calls.
The provider field names may be: 'facebook', 'twitter', 'yahoo', 'messenger', 'linkedin', 'sina', 'qq', 'renren'.
The sub-objects' fields are:

authTokenThe session authentication token.
Note: For Facebook this member should hold the Facebook Session Key.
tokenSecretThe session token secret.
Note: For Facebook this member should hold the Facebook sessionSecret.
tokenExpirationThe absolute time when the session token expires in UNIX time format.
sessionHandleThe session handle encoded in BASE64.
sessionHandleExpirationThe absolute time when the session expires in UNIX time format.

Note: If this parameter (providerSessions) is specified, the call must be done over HTTPS. 

handleInvalidSessionsstringThe possible values are:
  • Ignore (default) - ignore an expired providerSessions, meaning the provider will not be added to the user.
  • Error - returns an error in case any of the provider sessions are expired.

Notes:

  • * You must supply a value for either identities or providerSessions. If both parameters are missing, you will receive error 400002: Missing_required_parameter.
  • If both providerSessions and identities parameters are provided for the same provider, providerSessions takes precedence.
  • If both providerSessions and identities parameters are provided for the same provider,  providerSession is not valid and handleInvalidSessions is set to "ignore", the identities object for the provider will be imported.
  • If both providerSessions and identities parameters are provided for the same provider, the providerSession is valid but the provider UID does not match the provider UID in identities, an error is returned (400006: Invalid_parameter_value).

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

 

 

identityConflicts JSON objectContain the identities that caused a conflict. This field is returned if there are conflicts, both when returning an error and when returning success.
For example:
     "identityConflicts: [
      { "provider" : "facebook", "providerUID" : "1234" }
   ]
isImported *BooleanIndicates if the account was imported or not (*this field is internal and not public).

 

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

Response Example

{
    "statusCode": 200,
    "errorCode": 0,
    "statusReason": "OK",
    "callId": "3353d2fbac894289977c102298df60d1",
    "time": "2015-03-22T11:42:25.943Z",
    "identityConflicts": [
      { "provider" : "facebook", "providerUID" : "1234" }
   ]
    "isImported": true,
}