Skip to content

Latest commit

 

History

History
68 lines (59 loc) · 1.12 KB

File metadata and controls

68 lines (59 loc) · 1.12 KB

That document describes API that is used by clients to interact with ProjectHub

POST /api/v1/user/new

Registration

Request body:

{
	“email”:	string,
	“username”:	string,
	“password”:	string
}

Example:

curl --location --request POST 'https://cub.it/api/v1/user/new' \
--header 'Content-Type: application/json' \
--data-raw '{
	“email”: “template.email@gmail. com”,
	“username”: “Alex”,
	“password”: “Aa123456”
}'

Response:

HTTP status code: 200

{
	"token": "cabef633-3b34-45db-801f-d5b21b9e7bee",
	"userId": "21489"
}

POST /api/v1/user/login

Authorization

Request body:

{
	“email”:	string,
	“password”:	string
}

Example:

curl --location --request POST 'https://cub.it/login' \
--header 'Content-Type: application/json' \
--data-raw '{
	“email”: “template.email@gmail.com”,
	“password”: “Aa123456”
}'

Response:

HTTP status code: 200

{
	"token": "cabef633-3b34-45db-801f-d5b21b9e7bee",
	"userId" : "21489"
}