wiki:JSON_messaging

Version 13 (modified by till, 6 years ago) (diff)

Correct error (status : "ok") on "Login Response Failure (to client)"

JSON Messaging

Login Request (to server)

{
	requests :
	[
		{
			component : 'formauth',
			actions : 
			[
				{
					action : 'login',
					username : 'till',
					password : 'pw'
				}
			]
		}
	]
}

Login Response Successful (to client)

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

Login Response Failure (to client)

{
	status : 'failure',
	responses :
	[
		{
			component : 'formauth',
			actions :
			{
				action : 'showWarning',
				warning: 'Failure to authenticate, try again'
			}
		}
	]
}

Update Request (to server)

{
	requests :
	[
	
		{
			component : 'formauth',
			actions : 
			[
				{
					action : 'authenticate',
					token : '3423lkjjhdfSDfj234rlkjkfs'
				}
			]
		},
		{
			component : '*',
			actions : 
			[
				{
					action : 'getUpdates'
				}
			]
		}
	]
}

Update Response (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 :
					{
						messageId : '14312',
						subject : "Lunch meeting",
						sender : "Tom Cohen",
						date : "10.11.22 10:09:11",
						size : "1 KB"
					}
				},
				{
					action : 'addMessage',
					message :
					{
						messageId : '14319',
						subject : "Lunch meeting changed",
						sender : "Tom Cohen",
						date : "10.11.22 10:12:11",
						size : "2 KB"
					}
				}
			]
		}
	]
}

Delete Message Request (to server)

{
	requests :
	[
		{
			component : 'formauth',
			action : 'authenticate',
			token : '3423lkjjhdfSDfj234rlkjkfs'
		},
		{
			component : 'webmail',
			action : 'deleteMessage',
			messageId : '14312'
		}
	]
}

Delete Message Response (to client)

{
	status : 'ok',
	responses : 
	[
		{
			component : 'webmail',
			actions :
			{
				action : 'confirmDeleteMessage',
				messageId : '14312'
			}
		}
	]
}

Return to RoundCube vNext