survey

module
v0.0.0-...-fb08230 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2020 License: MIT

README

API Documentation

Health check

Request:

GET /api/v1/health_check

Successful Response:

HTTP/1.1 200 OK
{
  "message": "ok"
}

Auth

Login

Request:

GET /api/v1/login
Accept: application/json
Content-Type: application/json
{
	"username": "<username>",
	"password": "<password>"
}

Successful Response:

HTTP/1.1 200
Authorization: 	Bearer <token>

Failed Response:

HTTP/1.1 403 Forbidden 
HTTP/1.1 500 Internal server error
Register

More type of account need to be implemented

Actually only admin role can create account of role operator

Request:

POST /api/v1/auth/register
Accept: application/json
Content-Type: application/json
{
	"username": "<username>",
	"password": "<password>",
	"email": "<email>"
}

Successful Response:

HTTP/1.1 201
Authorization: 	Bearer <string>
{
  "message": "Account_created"
}

Failed Response:

HTTP/1.1 403 Forbidden 
HTTP/1.1 500 Internal server error

Directories

Path Synopsis
cmd
v1
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL