Skip to content

Latest commit

 

History

History
117 lines (97 loc) · 1.71 KB

README.md

File metadata and controls

117 lines (97 loc) · 1.71 KB

protectedchat-server

Server API

Requests

{
  "mode": "registration",
  "nickname": "?",
  "pw": "?"
}

{
  "mode": "authorisation",
  "nickname": "?",
  "pw": "?",
  "p2pip": "?"
}

{
  "mode": "logout",
  "token": "?"
}

{
  "mode": "getip",
  "token": "?",
  "nickname": "?"
}

{
  "mode": "addfriend",
  "token": "?",
  "nickname": "?"
}

{
  "mode": "removefriend",
  "token": "?",
  "nickname": "?"
}

{
  "mode": "getfriends",
  "token": "?"
}

{
  "mode": "update",
  "token": "?"
}

Replies

{
  "status": "registered",
  "nickname": "?"
}

{
  "status": "authorised",
  "nickname": "?",
  "token": "?"
}

{
  "status": "logouted",
  "nickname": "?"
}

{
  "status": "ip",
  "nickname": "?",
  "ip": "?"
}

{
  "status": "friendadded",
  "owner": "?",
  "friend": "?"
}

{
  "status": "friendremoved",
  "owner": "?",
  "friend": "?"
}

{
  "status": "friendlist",
  "nickname": "?",
  "list": "?"
}

{
  "status": "updated",
  "nickname": "?"
}

{
  "status": "error", // You can check http response code when error for additional info
  "errormsg": "?"    // for example code 400 - Bad request
}