Login

In the Ozeki Chat Client, the Login API request is the initial step when the client connects to the chat server, downloading crucial data essential for interaction. This request retrieves pivotal information such as the user's RSA private key, enabling decryption of conversation data for secure communication. Additionally, the API provides URLs for server communication and the WebSocket address for receiving notifications about changes in friends lists and conversations, enhancing the user's chat experience.

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