GetProfileInfoForCredentialIfExists
Retrieves profile information for the specified user. Silently fails, if profile does not exist, just returns null and success, instead of an error.
Service | Operation |
---|---|
friend | GET_PROFILE_INFO_FOR_CREDENTIAL_IF_EXISTS |
Method Parameters
Parameter | Description |
---|---|
externalId | External id. |
authenticationType | Associated authentication type. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string externalId = "profileId";
string 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.FriendService.GetProfileInfoForCredentialIfExists(externalId, authenticationType, successCallback, failureCallback);
const chat *externalId = "profileId";
const chat *authenticationType = "Facebook";
_bc->getFriendService()->getProfileInfoForCredentialIfExists(externalId, authenticationType, this);
NSString *externalId = @"profileId";
NSString *authenticationType = @"Facebook";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc friendService] getProfileInfoForCredentialIfExists:externalId
authenticationType:authenticationType
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String externalId = "profileId";
String authenticationType = "Facebook";
this; // implements IServerCallback
_bc.getFriendService().getProfileInfoForCredentialIfExists(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.getProfileInfoForCredentialIfExists(externalId, authenticationType, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var externalId = "profileId";
var authenticationType = AuthenticationType.facebook;
ServerResponse result = await _bc.friendService.getProfileInfoForCredentialIfExists(externalId:externalId, authenticationType:authenticationType);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var externalId = "profileId";
var authenticationType = "Facebook";
var friendProxy = bridge.getFriendServiceProxy();
var postResult = friendProxy.getProfileInfoForCredentialIfExists(externalId, authenticationType);
if (postResult.status == 200) {
// Success!
}
{
"service": "friend",
"operation": "GET_PROFILE_INFO_FOR_CREDENTIAL_IF_EXISTS",
"data":
{
"externalId": "profileId",
"authenticationType": "Facebook"
}
}
JSON Response
{
"status": 200,
"data": {}
}