Skip to main content
Version: 5.7.0

MergeUniversalIdentity

Merge the profile associated with the provided user ID with the current profile.

NOTE: If using the BrainCloudWrapper, once the merge is complete you should call SetStoredProfileId in the BrainCloudWrapper with the profileId returned in the Merge call.

Error Handling Example

public void FailureCallback(int statusCode, int reasonCode, string statusMessage, object cbObject) {
switch (reasonCode) {
case ReasonCodes.MISSING_IDENTITY_ERROR: { // User attempted to merge an identity that doesn't exist
/**
* Need to provide the correct information of the identity to merge
*/
break;
}
case ReasonCodes.DUPLICATE_IDENTITY_TYPE: { // Users cannot attach an identity of a type that exists on there account
/**
* Inform user to detach identities that are of the same type of the merging account,
* before the merge
*/
break;
}

default: { // Uncaught reasonCode
/**
* Log the unexpected reasonCode to your own internal logs,
* to implement needed error handling later
*/
break;
}
}
}
ServiceOperation
identityMERGE

Method Parameters

ParameterDescription
userIdThe player's user ID
passwordThe player's password

Usage

http://localhost:3000
string userId = "someId";
string password = "someToken";

_bc.IdentityService.MergeUniversalIdentity(
userId,
password,
SuccessCallback, FailureCallback);
JSON Response
{
"data": {
"profileId": "f94f7e2d-3cdd-4fd6-9c28-392f7875e9df"
},
"status": 200
}
Common Error Code

Status Codes

CodeNameDescription
40206MISSING_IDENTITY_ERRORA "profileId" was supplied in the authentication request submitted with new credentials. In other words the credentials record was not found in the brainCloud database. The solution would be to provide known credentials or not supply a "profileId" if the user is actually new.
40211DUPLICATE_IDENTITY_TYPEReturned when trying to attach an identity type that already exists for that profile. For instance you can have only one Universal identity for a profile.