User:Navarr/WiiBrew Internet API: Difference between revisions

From WiiBrew
Jump to navigation Jump to search
Navarr (talk | contribs)
Some more ideas.. thoughts?
Navarr (talk | contribs)
mNo edit summary
Line 7: Line 7:
This is still a developing idea.  I came up with it, and started writing, and this is where I am.  Next comes the code.  Please post any ideas on the [[User_talk:Navarr/WiiBrew Internet API|talk]] page.
This is still a developing idea.  I came up with it, and started writing, and this is where I am.  Next comes the code.  Please post any ideas on the [[User_talk:Navarr/WiiBrew Internet API|talk]] page.


Current URL: [http://www.gtaero.net/wiibrew/ gtaero.net/wiibrew] (may possibly change to wiibrew.gtaero.net in the future)
Current URL: [http://wiibrew.gtaero.net/ wiibrew.gtaero.net]


== Personal Ideas ==
== Personal Ideas ==

Revision as of 20:15, 4 June 2008

The WiiBrew Internet API, as I've so dubbed it, is basically just an HTTP PHP XML API (yes, I know.. i don't know what else to call it though) system that I've decided to start working on, that will operate in a way similar (but nowhere near like) the Facebook application system.

Developers will request an API Key (app that will use it [ALL APPS SHOULD HAVE DIFFERENT KEYS!]), reason for wanting/needing it, etc and it will probably almost always be approved.

It will work via HTTP POST protocol, and will output information in XML format.

This is still a developing idea. I came up with it, and started writing, and this is where I am. Next comes the code. Please post any ideas on the talk page.

Current URL: wiibrew.gtaero.net

Personal Ideas

Possible Example Code?

The below is by no means documentation, just ideas. This whole thing is like a notepad.

Store Variables

Send:

POST /setvar.php?app_key=KEY&setvars=VAR1&values=VALUE HTTP/1.1

or

POST /setvar.php?app_key=KEY&setvars=VAR1,VAR2&values=VALUE1,VALUE2&token=, HTTP/1.1

Get:

<?xml version="1.0"?>
<vars>
  <var name="VAR1" value="VALUE1" />
  <var name="VAR2" value="VALUE2" />
  <!-- etc... -->
</vars>

Reserved Variables (Can Not Set)

  • IP
  • Score
  • LIP
  • ID

Note, Display is a variable that should be reserved for their Display Name.

Leader Boards

Send:

POST /leaders.php?app_key=KEY&lbid=LEADER_BOARD_ID&vars=VAR1,VAR2 HTTP/1.1
<?xml version="1.0"?>
<leaderboard>
  <place num="1">
    <id>xxxxxxxxxxxx</id>
    <display>Registered Display Name (User's)</display>
    <score>xxx</score>
    <vars /> <!-- Application Requested Variables -->
  </place>
  <place num="2" />
  <!-- etc... -->
</leaderboard>

Matchup

Send:

POST /match.php?app_key=KEY&id=WII_ID&lip=192.168.15.9&min_amt=1&max_amt HTTP/1.1

Get:

<?xml version="1.0"?>
<matches amt="3"> <!-- Amount Returned.  If its lower than the Min, an error will be returned -->
  <match>
    <id>xxxxxxxxxxxx</id>
    <display>Registered Display Name (User's)</display>
    <ip>83.92.15.10</ip>
    <lip>192.168.15.10</lip> <!-- If your IP matches theirs, a Local IP should be needed to connect to -->
    <vars /> <!-- Application Requested Variables -->
  </match>
  <match /><!-- etc... -->
</matches>

or

<?xml version="1.0"?>
<error>
  <code>0</code>
  <human>Could not find enough users.</human>
</error>

Common Variable List

Variables that could/should and must (marked by a *) be included:

  • app_key (*) - Application's Unique Key
  • id - Wii's Messageboard ID
  • lip - Wii's Intranet IP Address (Local IP)
  • vars - Variables to be returned (if more than one, token MUST be set)
  • token - Seperator for Variables