FFGlory Gateway — Integration Docs
A single PHP endpoint that lets any website, Telegram bot, or app talk to the FFGlory Reseller API using nothing but an action name and a reseller API key.
01 Overview
What the gateway does and why it exists.
The real FFGlory Reseller API requires a specific HTTP method per
endpoint, a shared x-api-key master key header, and a
differently-shaped body for every action. This gateway hides all of
that behind one endpoint: https://www.api.ffglory.abhromodz.in/api/v1.
Every integration — a website's backend, a Telegram bot, a mobile
app, a cron script — calls that same URL the same way: send an
action name and the caller's own api_key,
get back FFGlory's JSON response, unchanged.
02 Setup
Already deployed if the endpoint badge above resolves to your real domain.
- Requires PHP with the
curlextension — enabled by default on virtually every cPanel host. - The gateway lives at
api/v1.phpwith an.htaccessrewrite so it answers at the clean URL/api/v1(no redirect, so POST bodies are never dropped). - No config file, no environment variables, no terminal access needed.
- Visit
https://www.api.ffglory.abhromodz.in/api/v1directly in a browser — with noactionparam it returns a small JSON self-check confirming the deployment and showing its own detected URL.
03 Request Format
Every call needs two things, sent as GET query params, POST form fields, or a POST JSON body.
| Field | Required | Description |
|---|---|---|
action | Always | Which action to run — see the table below. |
api_key | Most actions | The caller's own FFGlory reseller key (ak_...). |
| other fields | Depends | Passed straight through as the JSON body (POST) or query string (GET). |
Scroll table sideways →
GET https://www.api.ffglory.abhromodz.in/api/v1?action=balance&api_key=ak_xxx
POST https://www.api.ffglory.abhromodz.in/api/v1Content-Type: application/json
{"action": "launch-group", "api_key": "ak_xxx", "region": "me", "clan_id": "123456789"}
action=redeem-coupon&api_key=ak_xxx&code=AB12-CD34-EF56
04 Available Actions
Every action the gateway supports, mapped 1:1 to the FFGlory Reseller API.
| Action | Key | Extra fields | What it does |
|---|---|---|---|
me | Yes | — | Account info: username, credit balances, max groups. |
signup | No | username, password | Register a new FFGlory account. |
pricing | No | — | List regions and per-credit pricing (public). |
launch-group | Yes | region, clan_id | Launch a glory group for a clan (deducts 1 credit). |
my-groups | Yes | — | List the caller's groups and their status. |
group-action | Yes | action (restart/stop/delete/get-glory/get-clan-info), group_id | Manage or query one group. |
create-coupon | Yes | basic_credits, premium_credits | Create a coupon backed by the caller's own credits. |
my-coupons | Yes | — | List coupons the caller created. |
redeemed-coupons | Yes | — | List coupons the caller has redeemed. |
redeem-coupon | Yes | code | Redeem a coupon code for credits. |
cancel-coupon | Yes | code | Cancel an active coupon and refund its credits. |
transactions | Yes | — | List the last 50 purchase transactions. |
cancel-transaction | Yes | transaction_id | Cancel a pending transaction. |
group-history | Yes | — | Full group history with glory snapshots. |
glory-progression | Yes | group_id | Detailed glory timeline for one group. |
activity-log | Yes | — | Last 200 account activity events. |
notifications | Yes | — | Pending notifications (cleared once read). |
Scroll table sideways →
group-action's inner action field (which sub-action to run) is separate from the gateway's own top-level action=group-action.
05 Website Integration
Call the gateway from the browser, a PHP backend, or a plain HTML form.
Client-side JavaScript (fetch)
const res = await fetch('https://www.api.ffglory.abhromodz.in/api/v1', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
action: 'launch-group',
api_key: 'ak_xxx',
region: 'me',
clan_id: '123456789'
})
});
const data = await res.json();
console.log(data);
api_key directly in public front-end JavaScript — see Security Notes below.
PHP backend (cURL)
<?php
$ch = curl_init('https://www.api.ffglory.abhromodz.in/api/v1');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'action' => 'my-groups',
'api_key' => 'ak_xxx',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
Plain HTML form
<form action="https://www.api.ffglory.abhromodz.in/api/v1" method="POST">
<input type="hidden" name="action" value="redeem-coupon">
<input type="hidden" name="api_key" value="ak_xxx">
<input type="text" name="code" placeholder="Coupon code">
<button type="submit">Redeem</button>
</form>
06 Telegram Bot Integration
Example using python-telegram-bot and requests.
import requests
from telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes
GATEWAY = 'https://www.api.ffglory.abhromodz.in/api/v1'
def call_gateway(action: str, api_key: str, **fields) -> dict:
payload = {'action': action, 'api_key': api_key, **fields}
r = requests.post(GATEWAY, json=payload, timeout=30)
return r.json()
async def balance(update: Update, context: ContextTypes.DEFAULT_TYPE):
user_api_key = get_stored_key(update.effective_user.id) # your own storage
data = call_gateway('me', user_api_key)
if 'error' in data:
await update.message.reply_text(f"Error: {data['error']}")
return
await update.message.reply_text(
f"Basic: {data['basic_credits']} Premium: {data['premium_credits']}"
)
async def launch(update: Update, context: ContextTypes.DEFAULT_TYPE):
user_api_key = get_stored_key(update.effective_user.id)
region, clan_id = context.args[0], context.args[1]
data = call_gateway('launch-group', user_api_key, region=region, clan_id=clan_id)
if 'error' in data:
await update.message.reply_text(f"Error: {data['error']}")
return
await update.message.reply_text(f"Launched group: {data['group_id']}")
app = ApplicationBuilder().token('YOUR_TELEGRAM_BOT_TOKEN').build()
app.add_handler(CommandHandler('balance', balance))
app.add_handler(CommandHandler('launch', launch))
app.run_polling()
api_key (e.g. via a /setkey ak_xxx command saved to a small database), so one bot can serve many resellers or customers, each billed against their own credits.
07 Error Handling
Errors always come back as JSON with an error field, e.g. {"error": "Insufficient credits"}.
| Status | Source | Meaning |
|---|---|---|
| 400 | Gateway | Missing action, unknown action, or missing api_key for an action that needs one. |
| 502 | Gateway | Could not reach FFGlory's servers (network/timeout). |
| 401 | FFGlory | Invalid api_key. |
| 402 | FFGlory | Insufficient credits (response includes balance + prices). |
| 403 | FFGlory | Missing permissions, max groups reached, or max groups per clan reached. |
| 404 | FFGlory | Group not found or not owned by this account. |
| 409 | FFGlory | Conflicting operation already in progress. |
| 429 | FFGlory | Rate limited. |
Scroll table sideways →
error key before trusting the rest of the response — don't assume success just because a request completed.
08 Security Notes
- Always serve over HTTPS.
api_keytravels in plain query strings or JSON bodies with no extra encryption from the gateway itself — TLS is what protects it in transit. - Never embed a real reseller
api_keyin public front-end JavaScript, a mobile app binary, or a public repo. Anyone who reads it can spend that account's credits. Keep the key server-side and have the browser/app call your own backend, which then calls the gateway. - Give each end customer their own FFGlory account and key where possible (via the
signupaction), instead of sharing one reseller key across many users — this keeps usage traceable per customer and limits the damage if one key leaks. - Respect FFGlory's own rate limits (e.g. 5 coupon-redeem attempts per 60 seconds) — the gateway does not add its own throttling or caching.
- Consider adding your own layer of auth in front of this gateway (an IP allowlist, a shared secret header, or per-caller rate limiting) if it's reachable from the public internet and used by third parties you don't fully trust.