GetProfileInfoForExternalAuthIdIfExists
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_EXTERNAL_AUTH_ID_IF_EXISTS |
Method Parameters
Parameter | Description |
---|---|
externalId | The external id. |
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.GetProfileInfoForExternalAuthIdIfExists(externalId, externalAuthType, successCallback, failureCallback);
const chat *externalId = "username";
const chat *externalAuthType = "OAuth";
_bc->getFriendService()->getProfileInfoForExternalAuthIdIfExists(externalId, externalAuthType, this);
NSString *externalId = @"username";
NSString *externalAuthType = @"OAuth";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc friendService] getProfileInfoForExternalAuthIdIfExists:externalId
externalAuthType:externalAuthType
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String externalId = "username";
String externalAuthType = "OAuth";
this; // implements IServerCallback
_bc.getFriendService().getProfileInfoForExternalAuthIdIfExists(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.getProfileInfoForExternalAuthIdIfExists(externalId, externalAuthType, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var externalId = "username";
var externalAuthType = "OAuth";
ServerResponse result = await _bc.friendService.getProfileInfoForExternalAuthIdIfExists(externalId:externalId, externalAuthType:externalAuthType);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var externalId = "username";
var externalAuthType = "OAuth";
var friendProxy = bridge.getFriendServiceProxy();
var postResult = friendProxy.getProfileInfoForExternalAuthIdIfExists(externalId, externalAuthType);
if (postResult.status == 200) {
// Success!
}
{
"service": "friend",
"operation": "GET_PROFILE_INFO_FOR_EXTERNAL_AUTH_ID_IF_EXISTS",
"data":
{
"externalId": "username",
"externalAuthType": "OAuth"
}
}
JSON Response
{
"status": 200,
"data": {}
}