GetProfileInfoForCredential
Retrieves profile information for the specified user.
Does not require the calling user to be a friend of the other user.
Service | Operation |
---|---|
friend | GET_PROFILE_INFO_FOR_CREDENTIAL |
Method Parameters
Parameter | Description |
---|---|
externalId | External identifier. |
authenticationType | Associated authentication type. Full list of types can be found here. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string externalId = "profileId";
AuthenticationType authenticationType = AuthenticationType.Facebook;
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.Friend.GetProfileInfoForCredential(externalId, authenticationType, successCallback, failureCallback);
const char *externalId = "profileId";
AuthenticationType authenticationType = AuthenticationType::Facebook;
_bc->getFriend()->getProfileInfoForCredential(externalId, authenticationType, this);
NSString *externalId = @"profileId";
AuthenticationTypeObjc *authenticationType = [AuthenticationTypeObjc Facebook];
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc friendService] getProfileInfoForCredential:externalId
authenticationType:authenticationType
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String externalId = "profileId";
AuthenticationType authenticationType = AuthenticationType.Facebook;
this; // implements IServerCallback
_bc.getFriend().getProfileInfoForCredential(externalId, authenticationType, 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 = "profileId";
var authenticationType = "Facebook";
_bc.friend.getProfileInfoForCredential(externalId, authenticationType, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
// Use alternate method GetProfileInfoForCredentialIfExists()
var externalId = "profileId";
var authenticationType = "Facebook";
var friendProxy = bridge.getFriendServiceProxy();
var postResult = friendProxy.getProfileInfoForCredential(externalId, authenticationType);
if (postResult.status == 200) {
// Success!
}
{
"service": "friend",
"operation": "GET_PROFILE_INFO_FOR_CREDENTIAL",
"data": {
"externalId": "profileId",
"authenticationType": "Facebook"
}
}
JSON Response
{
"status": 200,
"data": {
"playerName": "",
"email": null,
"profileId": "bb05182d-ff0c-4740-ae65-482751e74949",
"summaryFriendData": {
"LEVEL": 7
}
}
}