Login

The login request is the first request called by the chat client when it logs into the chat server. This request downloads important data to be used to interact with the chat server. The most important of this is the RSA private key of the user. The RSA private key is used to decrypt conversation data. API URLs used to communicate with the chatserver and the websocket address to get notification about changes in the friends list and conversations are also downloaded. Of course the user's full name and nick name are also nice to have.

Login request

Method: POST
URL: ?srv=chatserver&api=chatlogin
Request headers: Content-Type: application/json
Ozeki-Station: stationId
POST data:
{
    "action": "login",
    "apikey": "d040b...dae0d0"
}

Successful login response

Response headers Content-Type: application/json
Response data:
{
    "status": "OK",
    "errormessage": "",
    "server": "2.0.0",
    "listeners": {
        "udp": "udp://localhost:9010",
        "ws": "ws://localhost:9011",
        "wss": "wss://localhost:9012"
    },
    "registration": "true",
    "rsakey": "-----BEGIN RSA PRIVATE KEY-----\r\nProc-Type: 4,
    	ENCRYPTED\r\nDEK-Info: AES-256-CFB,584eb...qx32QnqI9\r\n-----END RSA PRIVATE KEY-----",
    "userid": "aa68d2204cb2bb85f2de3b9aad0d86d7",
    "fullname": "Ozeki Alice",
    "nick": "Alice",
    "urls": {
        "login": "http://localhost/ozeki/index.php?srv=chatserver&api=chatlogin",
        "availability": "http://localhost/ozeki/index.php?srv=chatserver&api=chatavailability",
        "conversation": "http://localhost/ozeki/index.php?srv=chatserver&api=chatconversation",
        "conversationgroup": "http://localhost/ozeki/index.php?srv=chatserver&api=chatconversationgroup",
        "blocklist": "http://localhost/ozeki/index.php?srv=chatserver&api=chatblocklist",
        "fileserver": "http://localhost/ozeki/index.php?srv=chatserver&api=chatfileserver",
        "friends": "http://localhost/ozeki/index.php?srv=chatserver&api=chatfriends",
        "notification": "http://localhost/ozeki/index.php?srv=chatserver&api=chatnotification",
        "register": "http://localhost/ozeki/index.php?srv=chatserver&api=chatregister",
        "reports": "http://localhost/ozeki/index.php?srv=chatserver&api=chatreports"
    },
    "isdeveloper": false
}

Failed login response

Response headers Content-Type: application/json
Response data:
{
	"status":"ERROR",
	"errormessage":"Login failed. Invalid api key length."
}

Request header parameters

Ozeki-Station: This parameters contains a unique md5 hash of the client that connected to the chat server. This id is used to identify the client on the chat server, and to route notifications about conversation change, friend list change and other events to it through websocket.

Request parameters

action: This parameter is always set to "login" it tells the chat login api, that a login request is included in the post data.

apikey: This is the apikey generated by the api service. The server uses this key to authenticate the user.

More information