Jump to content

Applicants API is broken


Yang
 Share

Recommended Posts

https://politicsandwar.com/api/applicants/790

 

If you look carefully, there's no comma after a nation. 

 

{"nationid":57724,"nation":"Atlantica","leader":"Loozianajay","continent":"North America","cities":5,"score":340}{"nationid":59099,"nation":"Naxiznevi","leader":"Silverfrost","continent":"Europe","cities":3,"score":184}

 

should really be

{"nationid":57724,"nation":"Atlantica","leader":"Loozianajay","continent":"North America","cities":5,"score":340},{"nationid":59099,"nation":"Naxiznevi","leader":"Silverfrost","continent":"Europe","cities":3,"score":184}

 

Alternatively, you could also add the allianceposition from the /nation/ endpoint to the /nations/ endpoint, so we don't have to open up every single nations in a list to see whether they're an applicant.

 

Thank you!

Link to comment
Share on other sites

Yeah we've been trying for months to get the API to be consistent. Good luck :P

 

I've got notes around somewhere on each of the API endpoints, what they should be for consistency. Even posted a few of them.

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

  • Administrators

I've got this fixed locally, and I'll add the allianceposition field to the nations api. Should be pushed live soon.

 

For the record, the alliance position field takes values 0-5, each corresponding to the following:

 

0 : No Position (should only happen for nations not in an alliance)

1: Applicant

2: Member

3: Officer

4: Heir

5: Leader

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

  • Administrators

How did this even happen? There are typically functions that take care of this for you...

 

Forgot to increment the comma counter on this script.

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

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.