Guest User

Untitled

a guest
Jan 22nd, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. # AUTH SERVICE - API REFERENCE
  2.  
  3. Every endpoint in this service is visible without previous authentication (nor token at headers).
  4.  
  5. Each endpoints can return client/server errors (400/500).
  6.  
  7. ## TABLE OF CONTENTS
  8. * New user endpoint
  9. * Login endpoint
  10.  
  11. ## ENDPOINTS
  12.  
  13. ### New User
  14. Creates a new user in the platform, given some credentials.
  15.  
  16. For getting the token, you must use the *login* endpoint
  17.  
  18. #### Endpoint
  19. `POST /auth/new/`
  20.  
  21. #### Body Parameters
  22.  
  23. * username: string
  24. * password: string
  25.  
  26. #### Result
  27. ```js
  28. {
  29. "success": {
  30. "success": "User created"
  31. }
  32. }
  33. ```
  34.  
  35. ### Login
  36. Generates a signed token, given the user credentials. It expires in 10 minutes.
  37.  
  38. #### Endpoint
  39. `POST /auth/login/`
  40.  
  41. #### Body Parameters
  42.  
  43. * username: string
  44. * password: string
  45.  
  46. #### Result
  47. ```js
  48. {
  49. "success": {
  50. "token": "<token_string>"
  51. }
  52. }
  53. ````
Add Comment
Please, Sign In to add comment