GetProfileInfoForExternalAuthId
Retrieves profile information for the specified external auth user.
Does not require the calling user to be a friend of the other user.
Service | Operation |
---|---|
friend | GET_PROFILE_INFO_FOR_EXTERNAL_AUTH_ID |
Method Parameters
Parameter | Description |
---|---|
externalId | External identifier |
externalAuthType | The name of the custom authentication type (linked to a cloud script that performs authentication.) Configured via the Design | Authentication | External page of the Design Portal. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string externalId = "username";
string externalAuthType = "OAuth";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.FriendService.GetProfileInfoForExternalAuthId(externalId, externalAuthType, successCallback, failureCallback);
const char *externalId = "username";
const char *externalAuthType = "OAuth";
_bc->getFriendService()->getProfileInfoForExternalAuthId(externalId, externalAuthType, this);
NSString *externalId = @"username";
NSString *externalAuthType = @"OAuth";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc friendService] getProfileInfoForExternalAuthId:externalId
externalAuthType:externalAuthType
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String externalId = "username";
String externalAuthType = "OAuth";
this; // implements IServerCallback
_bc.getFriendService().getProfileInfoForExternalAuthId(externalId, externalAuthType, 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 externalId = "username";
var externalAuthType = "OAuth";
_bc.friend.getProfileInfoForExternalAuthId(externalId, externalAuthType, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
// Use alternate method GetProfileInfoForExternalAuthIdIfExists()
var externalId = "username";
var externalAuthType = "OAuth";
var friendProxy = bridge.getFriendServiceProxy();
var postResult = friendProxy.getProfileInfoForExternalAuthId(externalId, externalAuthType);
if (postResult.status == 200) {
// Success!
}
{
"service": "friend",
"operation": "GET_PROFILE_INFO_FOR_EXTERNAL_AUTH_ID",
"data": {
"externalId": "username",
"externalAuthType": "OAuth"
}
}
JSON Response
{
"status": 200,
"data": {
"playerName": "",
"email": null,
"playerId": "bb05182d-ff0c-4740-ae65-482751e74949",
"playerSummaryData": {
"LEVEL": 7
}
}
}