The Tangram API forms the backend for the Tangram project management web application, the Honors thesis project of Western Oregon University Computer Science and Business student Jared Petersen. The API is organized around REST and is designed to be fairly predictable and ordinary so that users can quickly get going. Similar to many REST APIs, the Tangram API is designed to have intuitive URLs that indicate what you're querying and utilize HTTP response codes in order to indicate the success or failure of your call. All responses, including errors, are in JSON format.

 authenticate

Authentication is stateless and is handled via JSON web tokens. Simply request a token from the /authenticate endpoint and use the token when making requests to secured endpoints. Tokens expire 24 hours from the moment they are requested.

None of the endpoints are currently secured currently for development purposes, though the functionality does exist.

request

POST http://api.tangr.am/authenticate

query parameters

parameter description required
email user's email address yes
password user's password yes

response

HTTP 200: OK

{
    "message": "User Authenticated!",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImpwZXRlcnNlbjExQHdvdS5lZHUiLCJpZCI6IjU1ZWJhYjIxMmY4ODUxNTQwZWEwMzk3ZiIsImlhdCI6MTQ0MTgyODQzMCwiZXhwIjoxNDQxOTE0ODMwfQ.7h1l1FPepFoV_8l4R-DhKnJCX7JImAHRYh8nuv58ksM"
}

 get all users

Returns all of the users. Does not currently support pagination.

request

GET http://api.tangr.am/users

response

HTTP 200: OK

[
    {
        "_id": "55ebab212f8851540ea0397f",
        "last_name": "Petersen",
        "first_name": "Jared",
        "email": "jpetersen11@wou.edu",
        "created": "2015-09-06T02:55:29.162Z"
    },
    {
        "_id": "55ebab262f8851540ea03980",
        "last_name": "Morse",
        "first_name": "Scot",
        "email": "morses@wou.edu",
        "created": "2015-09-06T02:55:34.319Z"
    },
    ...
]


 get single user

Returns a single user based on the user ID passed into the URL.

request

GET http://api.tangr.am/users/:userid

response

HTTP 200: OK

{
    "_id": "55ebab212f8851540ea0397f",
    "last_name": "Petersen",
    "first_name": "Jared",
    "email": "jpetersen11@wou.edu",
    "created": "2015-09-06T02:55:29.162Z"
}


 register new user

Register a new user. All passwords are automatically put through a one-encryption system for security purposes.

request

POST http://api.tangr.am/projects

query parameters

parameter description required
email email address of the user yes
first_name first name of the user yes
last_name last name of the user yes
password password of the user yes

response

HTTP 201: CREATED

{
    "message": "User Registered!"
}


 update single user

Update a single user based on the user ID passed into the URL.

request

PUT http://api.tangr.am/users/:userid

query parameters

parameter description required
email email address of the user yes
first_name first name of the user yes
last_name last name of the user yes
password password of the user yes

response

HTTP 200: OK

{
    "message": "User Updated!"
}


 delete single user

Delete a single user based on the user ID passed into the URL.

request

DELETE http://api.tangr.am/users/:userid

response

HTTP 200: OK

{
    "message": "User Deleted!"
}

 get all projects

Returns all of the projects. Does not currently support pagination.

request

GET http://api.tangr.am/projects

response

HTTP 200: OK

[
    {
        "_id": "55ebab432f8851540ea03981",
        "owner": "55ebab212f8851540ea0397f",
        "description": "Project 1 Description",
        "name": "Project 1",
        "members": ["55ebab212f8851540ea0397f"],
        "created": "2015-09-06T02:56:03.072Z"
    },
    {
        "_id": "55ebab4a2f8851540ea03982",
        "owner": "55ebab212f8851540ea0397f",
        "description": "Project 2 Description",
        "name": "Project 2",
        "members": ["55ebab212f8851540ea0397f"],
        "created": "2015-09-06T02:56:10.014Z"
    },
    ...
]


 get single project

Returns a single project based on the project ID passed into the URL.

request

GET http://api.tangr.am/projects/:projectid

response

HTTP 200: OK

{
    "_id": "55ebab432f8851540ea03981",
    "owner": "55ebab212f8851540ea0397f",
    "description": "Project 1 Description",
    "name": "Project 1",
    "members": ["55ebab212f8851540ea0397f"],
    "created": "2015-09-06T02:56:03.072Z"
}


 create new project

Create a new project with the given user as an owner.

request

POST http://api.tangr.am/projects

query parameters

parameter description required
name name of the project yes
description project's description no
owner project's owner as a user ID yes

response

HTTP 201: CREATED

{
    "message": "Project Created!"
}


 update single project

Update a single project based on the project ID passed into the URL.

request

PUT http://api.tangr.am/projects/:projectid

query parameters

parameter description required
name name of the project yes
description project's description yes
owner project's owner as a user ID yes

response

HTTP 200: OK

{
    "message": "Project Updated!"
}


 delete single project

Delete a single project based on the project ID passed into the URL.

request

DELETE http://api.tangr.am/projects/:projectid

response

HTTP 200: OK

{
    "message": "Project Deleted!"
}

 get all tasks

Returns all of the tasks. Does not currently support pagination.

request

GET http://api.tangr.am/tasks

response

HTTP 200: OK

[
    {
        "_id": "55ebab682f8851540ea03983",
        "project": "55ebab432f8851540ea03981",
        "owner": null,
        "description": "Task 1 Description",
        "name": "Task 1",
        "created": "2015-09-06T02:56:40.208Z"
    },
    {
        "_id": "55ebab6f2f8851540ea03984",
        "project": "55ebab432f8851540ea03981",
        "owner": null,
        "description": "Task 2 Description",
        "name": "Task 2",
        "created": "2015-09-06T02:56:47.116Z"
    },
    ...
]


 get single task

Returns a single task based on the task ID passed into the URL.

request

GET http://api.tangr.am/tasks/:taskid

response

HTTP 200: OK

{
    "_id": "55ebab432f8851540ea03981",
    "owner": "55ebab212f8851540ea0397f",
    "description": "Project 1 Description",
    "name": "Project 1",
    "members": ["55ebab212f8851540ea0397f"],
    "created": "2015-09-06T02:56:03.072Z"
}


 create new task

Create a new task.

request

POST http://api.tangr.am/tasks

query parameters

parameter description required
name name of the task yes
description description of the task no
owner tasks's owner as a user ID no
project project the task belongs to as a project ID yes

response

HTTP 201: CREATED

{
    "message": "Task Created!"
}


 update single task

Update a single task based on the task ID passed into the URL.

request

PUT http://api.tangr.am/tasks/:taskid

query parameters

parameter description required
name name of the task yes
description description of the task yes
owner tasks's owner as a user ID yes
project project the task belongs to as a project ID yes

response

HTTP 200: OK

{
    "message": "Task Updated!"
}


 delete single task

Delete a single task based on the task ID passed into the URL.

request

DELETE http://api.tangr.am/tasks/:taskid

response

HTTP 200: OK

{
    "message": "Task Deleted!"
}

 get all subtasks

Returns all of the subtasks. Does not currently support pagination.

request

GET http://api.tangr.am/subtasks

response

HTTP 200: OK

[
    {
        "_id":"55ebab992f8851540ea03985",
        "task":"55ebab682f8851540ea03983",
        "owner":null,
        "description":"Subtask 1 Description",
        "name":"Subtask 1",
        "created":"2015-09-06T02:57:29.400Z"
    },
    {
        "_id":"55ebaba12f8851540ea03986",
        "task":"55ebab682f8851540ea03983",
        "owner":null,
        "description":"Subtask 2 Description",
        "name":"Subtask 2",
        "created":"2015-09-06T02:57:37.103Z"
    },
    ...
]


 get single subtask

Returns a single subtask based on the subtask ID passed into the URL.

request

GET http://api.tangr.am/subtasks/:subtaskid

response

HTTP 200: OK

{
    "_id":"55ebab992f8851540ea03985",
    "task":"55ebab682f8851540ea03983",
    "owner":null,
    "description":"Subtask 1 Description",
    "name":"Subtask 1",
    "created":"2015-09-06T02:57:29.400Z"
}


 create new subtask

Create a new subtask.

request

POST http://api.tangr.am/subtasks

query parameters

parameter description required
name name of the subtask yes
description description of the subtask no
owner subtask's owner as a user ID yes
task task the subtask belongs to as a task ID yes

response

HTTP 201: CREATED

{
    "message": "Subtask Created!"
}


 update single subtask

Update a single subtask based on the subtask ID passed into the URL.

request

PUT http://api.tangr.am/subtask/:subtaskid

query parameters

parameter description required
name name of the subtask yes
description description of the subtask no
owner subtask's owner as a user ID yes
task task the subtask belongs to as a task ID yes

response

HTTP 200: OK

{
    "message": "Subtask Updated!"
}


 delete single subtask

Delete a single subtask based on the subtask ID passed into the URL.

request

DELETE http://api.tangr.am/subtasks/:subtaskid

response

HTTP 200: OK

{
    "message": "Subtask Deleted!"
}