API Reference v1.2
Client SDK Endpoints
Technical reference for building secure client-side applications. All calls must follow the application-protocol for session security and data integrity.
POST/api/1.2/
Initialization
Initializes a new session for the application. This must be the first call made by the client.
Request Parameters
| Parameter | Type | Description |
|---|---|---|
type* | string | Must be "init" |
name* | string | Your application name |
ownerid* | string | Your owner ID |
ver* | string | Application version |
Response Payload
JSON Response
{
"success": true,
"sessionid": "sess_1234567890",
"appinfo": {
"numUsers": "1250",
"numOnlineUsers": "45",
"version": "1.0"
}
}Standard Error Response
If something goes wrong (invalid key, session expired, etc), the server will return a `success: false` payload with a descriptive `message` field.
Client Implementation
C#C# / .NET Example
using FearAuth;
public static api FearAuthApp = new api(
name: "Your App Name",
ownerid: "your_owner_id",
secret: "your_app_secret",
version: "1.0"
);
// 1. Initialize
FearAuthApp.init();
// 2. Guest License Login
FearAuthApp.license("FEAR-XXXX-XXXX");
if (FearAuthApp.response.success) {
Console.WriteLine($"Welcome {FearAuthApp.user_data.username}!");
} else {
Console.WriteLine($"Error: {FearAuthApp.response.message}");
}C++C++ Example
#include "FearAuth.hpp"
using namespace FearAuth;
std::string name = "Your App Name";
std::string ownerid = "your_id";
std::string secret = "your_secret";
std::string version = "1.0";
std::string url = "https://api.fearauth.online/api/1.2/";
api FearAuthApp(name, ownerid, secret, version, url);
int main() {
FearAuthApp.init();
FearAuthApp.license("YOUR-KEY-HERE");
if (FearAuthApp.data.success) {
printf("Success!");
}
return 0;
}PYPython Example
from fearauth import api
# 1. Setup client
fearauthapp = api(
name="Your App Name",
ownerid="your_owner_id",
secret="your_secret",
version="1.0"
)
# 2. Init and Login
fearauthapp.init()
fearauthapp.license("YOUR-KEY-HERE")
print(f"Logged in as: {fearauthapp.user_data.username}")JVJava (Android) Example
import com.mirror.FearAuth;
FearAuth auth = new FearAuth(
"App Name",
"Owner ID",
"1.0",
"https://api.fearauth.online/api/1.2/",
getApplicationContext()
);
// Perform async license validation
new Thread(() -> {
try {
auth.init();
UserData user = auth.license("YOUR-KEY-HERE");
runOnUiThread(() -> showSuccess(user.getUsername()));
} catch (Exception e) {
showError(e.getMessage());
}
}).start();