FindUsersByExactName
Retrieves profile information for the exact matches of the specified text.
If there are more results than the maximum requested, then maximum requested results are returned.
Does not require the calling user to be a friend of the retrieved users.
Service | Operation |
---|---|
friend | FIND_USERS_BY_EXACT_NAME |
Method Parameters
Parameter | Description |
---|---|
searchText | The exact string to search for. |
maxResults | Maximum number of results to return. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string searchText = "someText";
int maxResults = 5;
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.FindUsersByExactName(searchText, maxResults, successCallback, failureCallback);
const char *searchText = "someText";
int maxResults = 5;
_bc->getFriendService()->findUsersByExactName(searchText, maxResults, this);
NSString *searchText = @"someText";
int maxResults = 5;
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc friendService] findUsersByExactName:searchText
maxResults:maxResults
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String searchText = "someText";
int maxResults = 5;
this; // implements IServerCallback
_bc.getFriendService().findUsersByExactName(searchText, maxResults, 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 searchText = "someText";
var maxResults = 5;
_bc.friend.findUsersByExactName(searchText, maxResults, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var searchText = "someText";
var maxResults = 5;
ServerResponse result = await _bc.friendService.findUsersByExactName(searchText:searchText, maxResults:maxResults);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var searchText = "someText";
var maxResults = 5;
var friendProxy = bridge.getFriendServiceProxy();
var postResult = friendProxy.findUsersByExactName(searchText, maxResults);
if (postResult.status == 200) {
// Success!
}
{
"service": "friend",
"operation": "FIND_USERS_BY_EXACT_NAME",
"data": {
"searchText": "someText",
"maxResults": 5
}
}
JSON Response
{
"status": 200,
"data": {
"matches": [
{
"profileId": "4f2edc69-b3c3-458b-8b4b-6bbd7259b55f",
"profileName": "Test2",
"playerSummaryData": null,
"pictureUrl": "http://somesite.com/test/picture.jpg"
}
],
"matchedCount": 1
}
}