wiki:JSON_messaging

Version 7 (modified by offwhite, 6 years ago) (diff)

--

JSON Messaging

Login Request Message (to server)

{
	component : 'formauth',
	action : 'login'
	data : {
		username : 'till',
		password : 'pw'
	}
}

Login Successful Message (to client)

{
	status : 'ok',
	responses : {
		component : 'formauth'
		actions : {
		{
			action : 'doLogin'
			token : 'l983lkjasdfSDfj234rlfgtfa',
			expiration : '10.11.22 10:07:11'
		}
	}
}

Update Request Message (to server)

{
	component : '*',
	action : 'update',
	token : '3423lkjjhdfSDfj234rlkjkfs'
}

Update Response Message (to client)

{
	status : 'ok',
	responses : {
		component : 'formauth'
		actions : {
		{
			action : 'updateToken'
			token : 'l983lkjasdfSDfj234rlfgtfa',
			expiration : '10.11.22 10:09:11'
		}
	},
	{
		component : 'webmail'
		actions : {
			{
				action : 'addMessage'
				message : {
					id : '14312',
					subject : "Lunch meeting",
					sender : "Tom Cohen",
					date : "10.11.22 10:09:11",
					size : "1 KB"
				}
			},
			{
				action : 'addMessage'
				message : {
					id : '14319',
					subject : "Lunch meeting changed",
					sender : "Tom Cohen",
					date : "10.11.22 10:12:11",
					size : "2 KB"
				}
			}
		}
	}
}