MergeAdvancedIdentity
Merge the profile associated with the provided credentials with the current profile.
Service | Operation |
---|---|
identity | MERGE |
Method Parameters
Parameter | Description |
---|---|
authenticationType | Universal, Universal, Facebook, etc |
ids | Auth IDs structure |
extraJson | Additional to piggyback along with the call, to be picked up by pre- or post- hooks. Leave empty string for no extraJson |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
AuthenticationType authenticationType = AuthenticationType.Universal;
AuthenticationIds ids;
ids.externalId = "authAdvancedUser";
ids.authenticationToken = "authAdvancedPass";
ids.authenticationSubType = "";
string extraJson = "{\"key\":\"value\"}";
_bc.IdentityService.MergeAdvancedIdentity(
authenticationType,
ids,
extraJson,
SuccessCallback, FailureCallback);
AuthenticationType authenticationType = AuthenticationType::Universal;
AuthenticationIds ids = { "authAdvancedUser", "authAdvancedPass", "" };
const char* extraJson = "{\"key\":\"value\"}";
_bc->getIdentityService()->mergeAdvancedIdentity(
authenticationType, ids, extraJson, this);
AuthenticationType authenticationType = [AuthenticationTypeObjc Universal];
AuthenticationIds *ids = [[AuthenticationIdsObjc alloc]init];
ids.externalId = @"authAdvancedUser";
ids.authenticationToken = @"authAdvancedPass";
ids.authenticationSubType = @"";
NSString * extraJson = "{\"key\":\"value\"}";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc identityService]
mergeAdvancedIdentity:authenticationType
ids:ids
extraJson:extraJson
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
AuthenticationType authenticationType = AuthenticationType.Universal;
AuthenticationIds ids = new AuthenticationIds ("authAdvancedUser", "authAdvancedPass", "");
string extraJson = "{\"key\":\"value\"}";
this; // implements IServerCallback
_bc.getIdentityService().mergeAdvancedIdentity(authenticationType, ids, extraJson, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var authenticationType = _bc.brainCloudClient.authentication.AUTHENTICATION_TYPE_UNIVERSAL;
var ids = {externalId: "authAdvancedUser", authenticationToken: "authAdvancedPass", authenticationSubType: ""};
var extraJson = {"key":"value"};
_bc.identity.mergeAdvancedIdentity(authenticationType, ids, extraJson, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var authenticationType = AuthenticationType.universal;
var ids = AuthenticationIds("authAdvancedUser", "authAdvancedPass", ""); // id, token, externalAuthName
var extraJson = {"key":"value"};
ServerResponse result = await _bc.identityService.mergeAdvancedIdentity(authenticationType:authenticationType, ids:ids, extraJson:extraJson);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
// N/A
// N/A
JSON Response
{
"data": {
"profileId": "f94f7e2d-3cdd-4fd6-9c28-392f7875e9df"
},
"status": 200
}