]> git.cworth.org Git - lmno-api/commitdiff
Document the new /profile API
authorCarl Worth <cworth@cworth.org>
Sat, 23 May 2020 18:26:00 +0000 (11:26 -0700)
committerCarl Worth <cworth@cworth.org>
Sat, 23 May 2020 18:26:00 +0000 (11:26 -0700)
This can be used to set a nickname, (and a set nickname can be used
instead of the "name" for the empires /register API).

api.text
lmno.txt

index 26f0a4d92f4e40ecf330b1832a5932208434a197..42d4f0ee459dbecc99f313da8557fbf522f8a826 100644 (file)
--- a/api.text
+++ b/api.text
@@ -97,7 +97,14 @@ For a specific game the following API endpoints are defined.
 
     Method: POST
 
-    Behavior: Adds a new player with "name" and "character" and assigns an id. Also will add a new empire with empty "captured" array
+    Behavior: Adds a new player with "name" and "character" and
+    assigns an id. Also will add a new empire with empty "captured"
+    array.
+
+    Note: If the client supports cookies and has previously set a
+    nickname in the current session via the upper-level /profile API,
+    then the name can be omitted from the data here and the profile
+    nickname will be used instead.
 
     Example data: { "name": "Carl", "character: "Elvis" }
 
index 3caa2361e8276e64b4033a6d2d088e7cec75825d..aaad24be331e760d10f3a6939165155b9fc97906 100644 (file)
--- a/lmno.txt
+++ b/lmno.txt
@@ -29,6 +29,16 @@ Type: Dynamic
 
   Redirects to https://lmno.games/<game_engine>/WXYZ/
 
+http://lmno.games/profile/
+--------------------------
+Method: PUT
+
+  Stores profile information in the current session.
+
+  Supported fields: nickname
+
+  Example data: { "nickname": "Carl" }
+
 https//lmno.games/new/<engine> (POST)
 -------------------------------------
 Type: Dynamic