mthmulders / gtd-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Things Done

This repository contains a small REST API, written in Spring Boot. The resources are related to David Allens Getting Things Done time management method.

CircleCI Quality Gate Status Technical Debt Coverage

API

1. Creating an account

curl -v -d 'username=john@doe.com&password=d03' \
    http://localhost:8080/public/users/register

The outcome is an authentication token.

Alternatively, store the token in an environment variable:

TOKEN=$(curl -d 'username=john@doe.com&password=d03' http://localhost:8080/public/users/register)

2. Logging in

curl -v -d 'username=john@doe.com&password=d03' \
    http://localhost:8080/public/users/login

The outcome again is an authentication token.

Alternatively, store the token in an environment variable:

TOKEN=$(curl -d 'username=john@doe.com&password=d03' http://localhost:8080/public/users/login)

3. Get information about logged-in user

Pre-conditions

  • the authentication token is stored in an environment variable TOKEN
curl -v -H "Authorization: Bearer $TOKEN" \
    http://localhost:8080/users/me

4. Working with your contexts

Pre-conditions

  • the authentication token is stored in an environment variable TOKEN

a. Getting your contexts

curl -v -H "Authorization: Bearer $TOKEN" \
    http://localhost:8080/contexts

b. Creating a new context

curl -v -H "Authorization: Bearer $TOKEN" \
        -H "Content-Type: application/json" \
        -d "{ \"name\": \"Example\" }" \
     http://localhost:8080/contexts

5. Working with your tasks

Pre-conditions

  • the authentication token is stored in an environment variable TOKEN

a. Creating a task in your context

curl -v -H "Authorization: Bearer $TOKEN" \
        -H "Content-Type: application/json" \
        -d "{ \"text\": \"Example\", \"context_id\": \"{context-id}\"  }" \
    http://localhost:8080/tasks/

b. Getting all tasks in your context

curl -v -H "Authorization: Bearer $TOKEN" \
    http://localhost:8080/contexts/{context-id}/tasks

About

License:MIT License


Languages

Language:Java 93.8%Language:HCL 5.2%Language:Shell 1.0%