Skip to content
This repository has been archived by the owner on Jan 28, 2019. It is now read-only.
Tuur Lievens edited this page Jun 18, 2018 · 18 revisions

Public API Routes

Register

POST /api/Account/Register

  • FirstName
  • LastName
  • Email
  • Password

Returns: JSON

  • Invalid input
{
    "success": false,
    "errors": [
        { "message": "The Email field is required." },
        { "message": "The Password field is required." }
    ]
}
  • Errors on registering

{
    "success": false,
    "errors": [
        {
            "message": "User name 'test@domain.com' is already taken.".
            "data": "DuplicateUserName"
        }
    ]
}
  • Successful registration
{ "success": true, data: { user: {USER MODEL}, token: "JWT TOKEN"} }

Login

POST /api/Account/Login

  • Email
  • Password

Returns: JSON

  • Invalid input
{
    "success": false,
    "errors": [
        { "message": "The Email field is required." },
        { "message": "The Password field is required." }
    ]
}
  • Failed login
{
    "success": false,
    "errors": [{
        "message": "Not logged in",
        "data": {
            "succeeded": false,
            "isLockedOut": false,
            "isNotAllowed": false,
            "requiresTwoFactor": false
        }
    }]
}
  • Successful login
{ "success": true, data: { user: {USER MODEL}, token: "JWT TOKEN"} }

Change account details

POST /api/Account/Edit

  • Email
  • FirstName
  • LastName

Returns: JSON (format like login & register)

Change password

POST /api/Account/Password

  • OldPassword
  • NewPassword
  • ConfirmPassword

Returns: JSON (format like login & register)

Forgot password

POST /api/Account/ForgotPassword

  • Email

Returns: JSON (format like login & register)

Reset password

POST /api/Account/ResetPassword

  • Email
  • Password
  • ConfirmPassword
  • Code (send via mail)

Returns: JSON (format like login & register)

Logout

GET /api/Account/Logout

Private API Routes

You need the following header: Bearer: JWT Token, you get a JWT token by logging in or registering. The server will refuse connection without or with a invalid JWT token.

Users

Get Logged in User

GET /api/Users/

Returns: JSON User with owning lists (items not populated)

Get User

GET /api/Users/{id}

Returns: JSON User with public owning lists (items not populated)

Request access to user lists

POST /api/Users/{id}

All owned lists

GET /api/Users/Lists

Returns: JSON [List] of logged in user (items not populated)

All subscribed lists

GET /api/Users/Subscriptions

Returns: JSON [List] of logged in user (items not populated)

Lists

New list

POST /api/Lists/

  • List model

Get owned or subscribed list By ID

GET /api/Lists/{id}

Returns: JSON List with all items

Partial edit list

PATCH /api/Lists/{id}

  • Partial list model like this:
[
	{
		"Op": "replace",
		"Path": "Name",
		"Value": "test"
	}
]

Overwrite list

PUT /api/Lists/{id}

  • List model

Send invitations on list

POST /api/Lists/{id}

Delete List

DELETE /api/Lists/{id}

Items

Toggle checkmark

PUT /api/Items/{id}

Edit item

For editing and (un)checking items.

PATCH /api/Items/{id}

  • JWT Token of item owner in Headers
  • Partial item model like this:
[
	{
		"Op": "replace",
		"Path": "Name",
		"Value": "test"
	}
]

New item

POST /api/Items/{id}

  • Item model

Delete Item

DELETE /api/Items/{id}

Notifications

Get all notifications for user

GET /api/Notifications/

Returns: JSON list of all Notifications

Mark all notifications as read

PUT /api/Notifications/

Returns: JSON list of all Notifications

Mark notification as read

PUT /api/Notifications/{id}