Alliances
The Alliance Model
The Allianc emodel contains information about an alliance, its towns, strength, and more.
Properties
- Name
id
- Type
- string
- Description
The MongoDB ObjectID of the player
- Name
name
- Type
- string
- Description
The Alliance Name
- Name
strength
- Type
- int
- Description
The alliance's Continent Conquest Strength
- Name
bbStrength
- Type
- int
- Description
The alliance's Balak Strength
- Name
leaderId
- Type
- ObjectId
- Description
The MongoDB ObjectID of the Town that owns the alliance.
- Name
townIds
- Type
- array
- Description
An array of Towns listed by their ObjectID
GET/alliances
List All Alliances
This endpoint allows you to retrieve a list of all alliances on Loka.
Optional Attributes
- Name
size
- Type
- integer
- Description
- Limit the number of alliances returned.
- Name
page
- Type
- integer
- Description
- Page of alliances to return.
Request
GET
/alliancesconst axios = require('axios');
axios.get('https://api.lokamc.com/alliances')
.then((response) => console.log(response.data));
Response
{
"id": "6090042fe4929b7aa6acc2f9",
"name": "Brandenburg Alliance",
"strength": 100.0,
"vulnerabilityWindow": 19,
"bbStrength": 100.0,
"townIds": [],
"leaderId": "6090042ce4929b7aa6acc115",
},
GET/alliances/search/findByName{?name}
Find Alliance by Name
This endpoint allows you to retrieve an Alliance by providing its name.
Request
GET
/alliances/search/findByNameconst axios = require('axios');
axios.get('https://api.lokamc.com/alliances/search/findByName', {
params: { name: 'Sand Force' }
}).then((response) => console.log(response.data));
Response
{
"_embedded": {
"alliances": [
{
"id": "6090042fe4929b7aa6acc2f9",
"name": "Brandenburg Alliance",
"strength": 100.0,
"vulnerabilityWindow": 19,
"bbStrength": 100.0,
"townIds": [],
"leaderId": "6090042ce4929b7aa6acc115",
},
}
}