Endpoints
Introduction
Server always responds in json content. On failure responds appropriate HTTP status code and json content.
public
GET /loginUsed to login without credentials eg. through Facebook
Request
GET /login?strategy=facebook&returnTo=https://example.com/login
GET /login?strategy=facebook&code=xyz
- URL query parameters:
strategy
- strategy to authenticate user eg.facebook
returnTo
- location to which client returns after authentication on third party servicecode
- depend on strategy, eg. authorization code
Response
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1Y2IyMDI4NGM0ZjY4MjM2ZTRiMjEyNjYiLCJleHAiOjE1NTUyNTAwMzUsImlhdCI6MTU1NTI0NjQzNX0.r0l5vTDFD5iYeMAlrYqb8lJUvcb3RVsja8rZU9kD0bc",
"expiresAt": 1555250035
}
public
POST /loginUsed to login with client credentials.
Request
POST /login HTTP/1.1
{
"strategy": "local",
"login": "[email protected]", // e-mail or name if usernames are enabled
"password": "StrongPassword12345"
}
- Arguments:
strategy
- strategy to authenticate user eg.local
login
password
Response
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1Y2IyMDI4NGM0ZjY4MjM2ZTRiMjEyNjYiLCJleHAiOjE1NTUyNTAwMzUsImlhdCI6MTU1NTI0NjQzNX0.r0l5vTDFD5iYeMAlrYqb8lJUvcb3RVsja8rZU9kD0bc",
"expiresAt": 1555250035
}
public
POST /registerUsed to register user or to complete registration.
Request
{
"userId": "5cb38f9fd626f92c241b5836",
"email": "[email protected]",
"password": "StrongPassword12345",
"name": "Kysune"
}
- Arguments:
userId
- pass this argument only while you complementing registration process.email
password
passwordConfirmation
- you can disable password confirmation in configuration.name
- pass this argument only while using usernames is enabled
You can use additional fields, read more.
Response
Just HTTP/1.1 200 OK
public
GET /lookup/:searchUsed to search user's id by name.
Request
GET /lookup/Kysune
- URL parameters:
:search
- username or e-mail (e-mails lookup is disabled by default)
Response
{
"id": "5cb38f9fd626f92c241b5836",
"name": "Kysune"
}
public
GET /assignAssigns third party accounts to already registered user. Same as GET /login, but on successed responds only
HTTP/1.1 200 OK
{}
private
POST /confirmations/newGenerates new confirmation.
Request
POST /confirmations/new HTTP/1.1
{
"userId": "5cb38f9fd626f92c241b5836",
"type": "removeProject1"
}
- Arguments:
userId
type
- unique confirmation keymeta
Response
Just HTTP/1.1 200 OK
public
GET /confirmations/confirm/:tokenConfirmes active confirmation.
Request
GET /confirmations/confirm/81c3acc3967b97e398bb70ef92ecc8cf9af3515328e7e0e34076b8f88225773d
- URL parameters:
token
Response
Just HTTP/1.1 200 OK
public
GET /confirmations/refresh/:typeRefreshes expired confirmation.
Request
GET /confirmations/refresh/removeProject1
- URL parameters:
type
- unique confirmation key
Response
Just HTTP/1.1 200 OK
public
GET /confirmations/isConfirmed/:typeChecks if confirmation is confirmed.
Request
GET /confirmations/isConfirmed/removeProject1
- URL parameters:
type
- unique confirmation key
Response
{
"confirmed": true
}