Difference between revisions of "Stkaddons API"

(Connect - Anonymous)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== List of Implemented Calls ==
+
== List of Implemented Calls ==  
 
=== Session Management ===
 
=== Session Management ===
 
  client-user.php?action=connect&user={nick}
 
  client-user.php?action=connect&user={nick}
Line 9: Line 9:
 
  client-action.php?action=vote&user={nick}&id={sess-id}&addon_id={addon}&vote={vote}
 
  client-action.php?action=vote&user={nick}&id={sess-id}&addon_id={addon}&vote={vote}
  
== Detailed Description of Calls ==
 
 
=== Connect - Anonymous ===
 
=== Connect - Anonymous ===
 
  client-user.php?action=connect&user={nick}
 
  client-user.php?action=connect&user={nick}
 
Responses:
 
Responses:
Success:
+
 
 +
- Success:
 
   <?xml version="1.0"?>
 
   <?xml version="1.0"?>
 
   <connection id="6350fee41faed540ddeb627e" registered="false" />
 
   <connection id="6350fee41faed540ddeb627e" registered="false" />
Failure (nick already used):
+
- Failure (nick already used):
 
   Nickname {nick} already used
 
   Nickname {nick} already used
  
 
=== Connect - User ===
 
=== Connect - User ===
 
  client-user.php?action=connect&user={nick}&password={password}
 
  client-user.php?action=connect&user={nick}&password={password}
Responses:
+
==== Responses====
Success (will regenerate session if one already exists):
+
* Success (will regenerate session if one already exists):
 
   <?xml version="1.0"?>
 
   <?xml version="1.0"?>
 
   <connection id="2556629a2107fd03345a3aeb" user="{user_id}" registered="true" />
 
   <connection id="2556629a2107fd03345a3aeb" user="{user_id}" registered="true" />
Failure (wrong credentials):
+
* Failure (wrong credentials):
 
   Invalid credentials
 
   Invalid credentials
Failure (password too short):
+
* Failure (password too short):
 
   Your password must be at least %d characters long.
 
   Your password must be at least %d characters long.
Failure (username too short):
+
* Failure (username too short):
 
   Your username must be at least %d characters long.
 
   Your username must be at least %d characters long.
  
 
[[Category:Stkaddons]]
 
[[Category:Stkaddons]]

Latest revision as of 20:38, 17 September 2016

List of Implemented Calls

Session Management

client-user.php?action=connect&user={nick}
client-user.php?action=connect&user={nick}&password={password}
client-user.php?action=disconnect&user={nick}&id={sess-id}
client-user.php?action=refresh&user={nick}&id={sess-id}

Voting

client-action.php?action=vote&user={nick}&id={sess-id}&addon_id={addon}&vote={vote}

Connect - Anonymous

client-user.php?action=connect&user={nick}

Responses:

- Success:

  <?xml version="1.0"?>
  <connection id="6350fee41faed540ddeb627e" registered="false" />

- Failure (nick already used):

  Nickname {nick} already used

Connect - User

client-user.php?action=connect&user={nick}&password={password}

Responses

  • Success (will regenerate session if one already exists):
  <?xml version="1.0"?>
  <connection id="2556629a2107fd03345a3aeb" user="{user_id}" registered="true" />
  • Failure (wrong credentials):
  Invalid credentials
  • Failure (password too short):
  Your password must be at least %d characters long.
  • Failure (username too short):
  Your username must be at least %d characters long.