-
Notifications
You must be signed in to change notification settings - Fork 0
Initialization
dex edited this page Jan 15, 2022
·
2 revisions
To initialize your client you simply have to create a new instance of the AternosClient class providing your session token in the constructor. After that you have to call the #PrepareAsync method which will try to fetch the current ajax token which is required to access the endpoints. Because of anti bot measurements the fetching process can potentially fail, by default it's limited to 200 attempts (should take way less attempts to successfully get the token). Success is being indicated by the return value of the method, true meaning that the ajax token has been fetched successfully and false meaning that it failed to fetch it after 200 attempts.
var aternosClient = new AternosClient("<YOUR ATERNOS TOKEN>");
var response = await aternosClient.PrepareAsync();
if (response.Failed()) {
Console.WriteLine("Failed to fetch ajax token!");
return;
}
// Proceed