Update 'api.md'

This commit is contained in:
William Mantly 2018-02-14 04:28:57 +00:00
parent 9944394e3d
commit ecf92b12d3

7
api.md
View File

@ -7,8 +7,12 @@ curl -H "Content-Type: application/json" -H "auth-token: 0b06eb2e-4ca4-4881-9a0f
## sing up ## sing up
```bash ```bash
curl -H "Content-Type: application/json" -X POST -d "{\"username\": \"william\", \"password\": \"palm7\"}" http://localhost:3000/auth/5caf94d2-2c91-4010-8df7-968d10802b9d curl -H "Content-Type: application/json" -X POST -d "{\"username\": \"test9\", \"password\": \"palm7\"}" http://localhost:3000/auth/invite/b33d8819-ec64-4cf4-a6ec-77562d738fa4
200 {"user":"test9","token":"af662d8b-3d44-4110-8ad9-047dc752d97f"}
400 {"message":"Missing fields"}
401 {"message":"Token not valid"}
409 {"message":"username taken"}
``` ```
## login ## login
@ -25,3 +29,4 @@ curl -H "Content-Type: application/json" -X POST -d "{\"key\":\"ssh-rsa AAAAB3Nz
good 200 {"info":"4096 SHA256:dfdCYzt0atMBXVZTJzUxsu99IjXXFXpocSox5q+jOs8 wmantly@gmail.co (RSA)\n"} good 200 {"info":"4096 SHA256:dfdCYzt0atMBXVZTJzUxsu99IjXXFXpocSox5q+jOs8 wmantly@gmail.co (RSA)\n"}
bad 400 {"message":"Key is not a public key file!"} bad 400 {"message":"Key is not a public key file!"}
``` ```