Jump to content

Alliance API Layout Suggestion


Shakyr
 Share

Recommended Posts

Revamped my suggestion after some research and talking to a few people.

 

Suggestion for the Alliance API endpoints, that introduces a bit of consistency and groups a few related values.

 

api/alliances/

- two options

- summary of basic stats, good for the stat junkies to quickly update

{
	allianceid,
	name,
	color,
	memberCount,
	vacationCount,
	applicantCount,
	score,
	avgscore
}
api/alliances/<allianceid>/

- specific lookup for an alliance

{
	allianceid,
	name,
	acronym,
	color,
	rank,
	memberCount, /* includes those on vacation */
	vacationCount,
	applicantCount, /* includes those on vacation */
	canjoinalliance,
	score,
	avgscore,
	datefounded,
	continent,
	flagurl,
	forumurl,
	ircchan,
	stats {
		gdp,
		cities,
		infrastructure,
		landarea,
		population,
		treasures
	},
	military {
		soldiers,
		tanks,
		aircraft,
		ships,
		missiles,
		nukes
	}
}
I've deliberately left actual members out (officerids, leaderids, heirids), because they really need their own lookup API.

 

api/alliances/<allianceid>/members/

- list of members in the alliance

- includes those on vacation

- excludes applicants

{
	{
		alliancerank, /* by score */
		nationid,
		leader=0/1,
		heir=0/1,
		officer=0/1
	},
	{
		...
	}
}
api/alliances/<allianceid>/leaders/

- list of leaders in the alliance

- includes those on vacation

{
	<nationid>,
	<nationid>,
	...
}
api/alliances/<allianceid>/heirs/

- list of heirs in the alliance

- includes those on vacation

{
	<nationid>,
	<nationid>,
	...
}
api/alliances/<allianceid>/officers/

- list of officers in the alliance

- includes those on vacation

{
	<nationid>,
	<nationid>,
	...
}
api/alliances/<allianceid>/applicants/

- list of applicants in the alliance

- includes those on vacation

{
	<nationid>,
	<nationid>,
	...
}
Edited by Shakyr
  • Upvote 2

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the Guidelines of the game and community.