Scrambled Nations API
Principles
- Access the API via https://scramblednations.mrpetovan.com/?page=api&m=%5Bmethod%5D
- All return values are JSON
- HTTP Header 403 means that the token is absent, invalid or expired
- HTTP Header 500 means that the parameters are wrong or that the method failed for any reason.
Protocol
- Request a token using the request_token method. The token lives for 1 hour.
- Add a token parameter to any method with the hash given by request_token.
Methods
request_token
- player_id : Player Id
- sig : Signature = sha1([player_id][api_key])
get_game
- game_id : Game Id
get_current_game
get_last_game
get_world
- [world_id] : World Id (optional)
get_territory
- territory_id : Territory Id
get_last_player_diplomacy_list
change_diplomacy_status
- player_id : Player Id
- status : New diplomatic status (Ally/Neutral/Enemy)
ready
notready
get_game_player_list
- [game_id] : Game Id (optional)
get_territory_summary
- [turn] : Turn (optional)
get_territory_status_list
- [turn] : Turn (optional)
get_territory_player_troops_list
- [turn] : Turn (optional)
get_player_history_list
get_shout_list
- [game_related] : Game related (optional)
get_territory_owner
- territory_id : Territory Id
- [turn] : Turn (optional)
get_territory_is_contested
- territory_id : Territory Id
- [turn] : Turn (optional)
get_territory_is_capital
- territory_id : Territory Id
- [turn] : Turn (optional)
get_territory_neighbour_list
- territory_id : Territory Id
get_territory_list
- [world_id] : World Id (optional)
- [game_id] : Game Id (optional)
- [turn] : Turn (optional)
- [sort_field] : Sort field (name/owner)(optional)
- [sort_direction] : Sort Direction (1/0)(optional)
move_troops
- from_territory_id : Source Territory Id
- to_territory_id : Destination Territory Id
- count : Number of troops moved
give_troops
- from_territory_id : Source Territory Id
- to_player_id : Recipient Player Id
- count : Number of troops gifted
give_tribute
- to_player_id : Recipient Player Id
- count : Tribute amount
change_capital
- territory_id : Destination Territory Id
quit_game
get_planned_orders
cancel_order
- planned_order_id : Planned Order Id