Update README with new API
This commit is contained in:
		
							
								
								
									
										50
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										50
									
								
								README.md
									
									
									
									
									
								
							@@ -30,17 +30,57 @@ Chookpen is very simple in how it works at present. There's only one chat on eac
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### Brief API documentation for the server
 | 
					### Brief API documentation for the server
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Create account**
 | 
					#### Create account
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Usage**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
`http://(address:port)/api/createAccount/username:{(username)}token:{(password-hash)}`
 | 
					`http://(address:port)/api/createAccount/username:{(username)}token:{(password-hash)}`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Send a message**
 | 
					**Successful response**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
`http://(address:port)/api/username:{(username)}token:{(password-hash)}message:{(message to send)}`
 | 
					`Success`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Get messages**
 | 
					**Unsuccessful responses**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
`http://(address:port)/api/username:{(username)}token:{(password-hash)}`
 | 
					`Username already exists` - Choose a new username
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`No username` - Add a username
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`No token` - Add a token
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Send a message
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Usage**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`http://(address:port)/api/send/username:{(username)}token:{(password-hash)}message:{(message to send)}`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Successful response**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`Success`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Unsuccessful responses**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`Unknown account` - Either you don't have an account or your username is wrong
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`Invalid token` - Password is wrong
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`No data provided` - Add a message
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Get messages
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Usage**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`http://(address:port)/api/syncmessages/username:{(username)}token:{(password-hash)}`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Successful response**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					A successful response should contain everything in `chatHistory` in the directory you run the server in.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Unsuccessful responses**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`Unknown account` - Either you don't have an account or your username is wrong
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`Invalid token` - Password is wrong
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Some handy tips and tricks
 | 
					## Some handy tips and tricks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user