GetApplicantsV3
public BackendReturnObject GetApplicantsV3();
public BackendReturnObject GetApplicantsV3(int limit);
public BackendReturnObject GetApplicantsV3(int limit, int offset);
Parameters
Value | Type | Description | default |
---|---|---|---|
limit | int | (Optional) Number of the lists of users who request to join | 100 |
offset | int | (Optional) Starting point to look up the list of users who request to join(offset) | 0 |
Description
The list of users who request to join the guild is looked up.
The applicant list is sorted according to a first-come, first-served rule.
If users 1, 2, and 3 apply in order, the list will show User 1 in the 0th place, User 2 in the 1st place, and User 3 in the 2nd place.
Example
Synchronous
Backend.Guild.GetApplicantsV3();
Backend.Guild.GetApplicantsV3(5);
Backend.Guild.GetApplicantsV3(5, 5);
Asynchronous
Backend.Guild.GetApplicantsV3((callback) =>
{
// Post-process
});
Backend.Guild.GetApplicantsV3(5, (callback) =>
{
// Post-process
});
Backend.Guild.GetApplicantsV3(5, 5, (callback) =>
{
// Post-process
});
SendQueue
SendQueue.Enqueue(Backend.Guild.GetApplicantsV3, (callback) =>
{
// Post-process
});
SendQueue.Enqueue(Backend.Guild.GetApplicantsV3, 5, (callback) =>
{
// Post-process
});
SendQueue.Enqueue(Backend.Guild.GetApplicantsV3, 5, 5, (callback) =>
{
// Post-process
});
Return cases
Success cases
When the lookup is successful
statusCode : 200
returnValue : refer to GetReturnValuetoJSON
When the user is not a guild master or manager
statusCode : 403
errorCode : ForbiddenException
When a user who has not joined a guild calls the method
statusCode : 412
errorCode : PreconditionFailed
GetReturnValuetoJSON
{
rows:
[
{
inDate:{ S:"2018-07-31T01:34:41.461Z" }, // indate of the user who requested to join
nickname:{ S:"customid10" } // Nickname of the user who requested to join
},
{
inDate:{ S:"2018-07-31T01:49:47.260Z" },
nickname:{ S:"customid4" }
}
]
}
Sample code
public class ApplicantsItem
{
public string inDate;
public string nickname;
public override string ToString()
{
return $"nickname : {nickname}\ninDate : {inDate}\n";
}
}
public void GetApplicantsV3()
{
var bro = Backend.Guild.GetApplicantsV3();
if(!bro.IsSuccess())
return;
List<ApplicantsItem> applicantsList = new List<ApplicantsItem>();
LitJson.JsonData applicantsListJson = bro.FlattenRows();
for(int i = 0; i < applicantsListJson.Count; i++)
{
ApplicantsItem applicant = new ApplicantsItem();
if(applicantsListJson[i].ContainsKey("nickname"))
{
applicant.nickname = applicantsListJson[i]["nickname"].ToString();
}
applicant.inDate = applicantsListJson[i]["inDate"].ToString();
applicantsList.Add(applicant);
Debug.Log(applicant.ToString());
}
}