Tommy API Reference

The Tommy API is organized around the REST methodology, and it uses resource-oriented URLs, and common HTTP response codes to indicate API errors. All requests are authenticated using an api-key which can be obtained from your developer dashboard.

API Endpoint
https://api.mytommy.com/v1
Schemes: http, https
Version: 1.0.0

Authentication

basicAuth

description
HTTP Basic Authentication. Works over `HTTP` and `HTTPS`

api_key

name
api_key
in
header

User

GET /user

Get the current user object.

200 OK

User response

default

Unexpected error

Response Example (200 OK)
{
  "dob": "string",
  "email": "string",
  "first_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "last_name": "string",
  "phone": "string",
  "status": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

PUT /user

Update the current user object.

User response

Request Example
{
  "dob": "string",
  "email": "string",
  "first_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "last_name": "string",
  "phone": "string",
  "status": "string"
}
200 OK

User response

default

Unexpected error

Response Example (200 OK)
{
  "dob": "string",
  "email": "string",
  "first_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "last_name": "string",
  "phone": "string",
  "status": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

GET /user/accounts

Get all accounts belonging to the current user.

200 OK

Account response

default

Unexpected error

Response Example (200 OK)
[
  {
    "display_name": "string",
    "icon_url": "string",
    "id": "integer(int64)",
    "location_id": "integer(int64)",
    "title": "string",
    "type": "string"
  }
]
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Get the current account

GET /user/current_account

Get the current user account.

200 OK

Account response

default

Unexpected error

Response Example (200 OK)
{
  "display_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "location_id": "integer(int64)",
  "title": "string",
  "type": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Update the current account

PUT /user/current_account

Update the current user account. \ The current account may be a User, Team, or TeamMember type.

current_account_id

(no description)

type
integer (int64)
in
query
current_account_type

(no description)

type
string
in
query
200 OK

Account response

default

Unexpected error

Response Example (200 OK)
{
  "display_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "location_id": "integer(int64)",
  "title": "string",
  "type": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

POST /users

Create a User on the system.

UserInput response

Request Example
{
  "allOf": [
    {
      "$ref": "#/definitions/User"
    },
    {
      "properties": {
        "password": {
          "type": "string"
        }
      }
    }
  ]
}
201 Created

User response

default

Unexpected error

Response Example (201 Created)
{
  "dob": "string",
  "email": "string",
  "first_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "last_name": "string",
  "phone": "string",
  "status": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

GET /users

Get all Users the authenticated User has access to.

200 OK

User response

default

Unexpected error

Response Example (200 OK)
[
  {
    "dob": "string",
    "email": "string",
    "first_name": "string",
    "icon_url": "string",
    "id": "integer(int64)",
    "last_name": "string",
    "phone": "string",
    "status": "string"
  }
]
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Confirm a user account

GET /users/confirm/{confirmation_token}

Confirm a user account using the given confirmation token.

confirmation_token

(no description)

type
string
in
path
200 OK

User response

default

Unexpected error

Response Example (200 OK)
{
  "dob": "string",
  "email": "string",
  "first_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "last_name": "string",
  "phone": "string",
  "status": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

GET /users/{id}

Get a single User object by it's ID.

id

(no description)

type
integer (int64)
in
path
200 OK

User response

default

Unexpected error

Response Example (200 OK)
{
  "dob": "string",
  "email": "string",
  "first_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "last_name": "string",
  "phone": "string",
  "status": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

PUT /users/{id}

Update a single User object.

User response

id

(no description)

type
integer (int64)
in
path
Request Example
{
  "dob": "string",
  "email": "string",
  "first_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "last_name": "string",
  "phone": "string",
  "status": "string"
}
200 OK

User response

default

Unexpected error

Response Example (200 OK)
{
  "dob": "string",
  "email": "string",
  "first_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "last_name": "string",
  "phone": "string",
  "status": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Login

POST /sessions

This method handles users who are \ authenticating with an email and password combination.

UserCredentials response

Request Example
{
  "email": "string",
  "password": "string"
}
200 OK

User response

default

Unexpected error

Response Example (200 OK)
{
  "dob": "string",
  "email": "string",
  "first_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "last_name": "string",
  "phone": "string",
  "status": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Logout

DELETE /sessions

This method destroys the current user session.

200 OK

Success response

default

Unexpected error

Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Account

Get the current account

GET /user/current_account

Get the current user account.

200 OK

Account response

default

Unexpected error

Response Example (200 OK)
{
  "display_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "location_id": "integer(int64)",
  "title": "string",
  "type": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Update the current account

PUT /user/current_account

Update the current user account. \ The current account may be a User, Team, or TeamMember type.

current_account_id

(no description)

type
integer (int64)
in
query
current_account_type

(no description)

type
string
in
query
200 OK

Account response

default

Unexpected error

Response Example (200 OK)
{
  "display_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "location_id": "integer(int64)",
  "title": "string",
  "type": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Chat

Create a chat room

POST /chats

Create a chat room with multiple users.

Chat response

Request Example
{
  "id": "integer(int64)",
  "open": "boolean",
  "owner_id": "integer(int64)",
  "team_id": "integer(int64)",
  "title": "string",
  "users": "array"
}
201 Created

Chat response

default

Unexpected error

Response Example (201 Created)
{
  "id": "integer(int64)",
  "open": "boolean",
  "owner_id": "integer(int64)",
  "team_id": "integer(int64)",
  "title": "string",
  "users": "array"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Get all chat rooms

GET /chats

Get all chat rooms.

200 OK

Chat response

default

Unexpected error

Response Example (200 OK)
[
  {
    "id": "integer(int64)",
    "open": "boolean",
    "owner_id": "integer(int64)",
    "team_id": "integer(int64)",
    "title": "string",
    "users": "array"
  }
]
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Get or create a chat room

POST /chats/initiate

Get or create a chat room with multiple given users.

ChatInitiateInput response

Request Example
{
  "user_ids": "array"
}
200 OK

Chat response

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer(int64)",
  "open": "boolean",
  "owner_id": "integer(int64)",
  "team_id": "integer(int64)",
  "title": "string",
  "users": "array"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Get a chat

GET /chats/{id}

Get a single chat object by it's ID.

id

(no description)

type
integer (int64)
in
path
200 OK

Chat response

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer(int64)",
  "open": "boolean",
  "owner_id": "integer(int64)",
  "team_id": "integer(int64)",
  "title": "string",
  "users": "array"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Update a chat

PUT /chats/{id}

Update a single chat object.

Chat response

id

(no description)

type
integer (int64)
in
path
Request Example
{
  "id": "integer(int64)",
  "open": "boolean",
  "owner_id": "integer(int64)",
  "team_id": "integer(int64)",
  "title": "string",
  "users": "array"
}
200 OK

Chat response

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer(int64)",
  "open": "boolean",
  "owner_id": "integer(int64)",
  "team_id": "integer(int64)",
  "title": "string",
  "users": "array"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Get chat messages

GET /chats/{chat_id}/messages

Get all messages belonging to the given chat.

id

(no description)

type
integer (int64)
in
path
200 OK

Message response

default

Unexpected error

Response Example (200 OK)
[
  {
    "allOf": [
      {
        "$ref": "#/definitions/MessageInput"
      },
      {
        "properties": {
          "chat_title": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "sender_first_name": {
            "type": "string"
          },
          "sender_icon_url": {
            "type": "string"
          },
          "sender_last_name": {
            "type": "string"
          }
        }
      }
    ]
  }
]
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Get chat users

GET /chats/{chat_id}/users

Get all users participating in the given chat.

id

(no description)

type
integer (int64)
in
path
200 OK

User response

default

Unexpected error

Response Example (200 OK)
[
  {
    "dob": "string",
    "email": "string",
    "first_name": "string",
    "icon_url": "string",
    "id": "integer(int64)",
    "last_name": "string",
    "phone": "string",
    "status": "string"
  }
]
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

POST /messages

Create and send a chat message to the receiver.

MessageInput response

Request Example
{
  "chat_id": "integer(int64)",
  "created_at": "string(date-time)",
  "kind": "string",
  "message": "string",
  "receiver_id": "integer(int64)",
  "send_at": "string(date-time)",
  "sender_id": "integer(int64)"
}
201 Created

Message response

default

Unexpected error

Response Example (201 Created)
{
  "allOf": [
    {
      "$ref": "#/definitions/MessageInput"
    },
    {
      "properties": {
        "chat_title": {
          "type": "string"
        },
        "id": {
          "format": "int64",
          "type": "integer"
        },
        "sender_first_name": {
          "type": "string"
        },
        "sender_icon_url": {
          "type": "string"
        },
        "sender_last_name": {
          "type": "string"
        }
      }
    }
  ]
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Get recent chat messages

GET /messages/recent

Get recent chat messages for the current account scope.

200 OK

Message response

default

Unexpected error

Response Example (200 OK)
[
  {
    "allOf": [
      {
        "$ref": "#/definitions/MessageInput"
      },
      {
        "properties": {
          "chat_title": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "sender_first_name": {
            "type": "string"
          },
          "sender_icon_url": {
            "type": "string"
          },
          "sender_last_name": {
            "type": "string"
          }
        }
      }
    ]
  }
]
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Contact

POST /contacts

Create a Contact on the system.

ContactInput response

Request Example
{
  "favorite": "boolean",
  "group": "string",
  "id": "integer(int64)",
  "order": "integer(int32)",
  "owner_id": "integer(int64)",
  "status": "string",
  "team_id": "integer(int64)",
  "user_id": "integer(int64)"
}
201 Created

Contact response

default

Unexpected error

Response Example (201 Created)
{
  "allOf": [
    {
      "$ref": "#/definitions/ContactInput"
    },
    {
      "properties": {
        "first_name": {
          "type": "string"
        },
        "icon_url": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      }
    }
  ]
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

GET /contacts

Get all Contacts belonging to the current account.

200 OK

Contact response

default

Unexpected error

Response Example (200 OK)
[
  {
    "allOf": [
      {
        "$ref": "#/definitions/ContactInput"
      },
      {
        "properties": {
          "first_name": {
            "type": "string"
          },
          "icon_url": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          }
        }
      }
    ]
  }
]
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Get a contact

GET /contacts/{id}

Get a single contact object by it's ID.

id

(no description)

type
integer (int64)
in
path
200 OK

Contact response

default

Unexpected error

Response Example (200 OK)
{
  "allOf": [
    {
      "$ref": "#/definitions/ContactInput"
    },
    {
      "properties": {
        "first_name": {
          "type": "string"
        },
        "icon_url": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      }
    }
  ]
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Update a contact

PUT /contacts/{id}

Update a single contact object.

Contact response

id

(no description)

type
integer (int64)
in
path
Request Example
{
  "allOf": [
    {
      "$ref": "#/definitions/ContactInput"
    },
    {
      "properties": {
        "first_name": {
          "type": "string"
        },
        "icon_url": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      }
    }
  ]
}
200 OK

Contact response

default

Unexpected error

Response Example (200 OK)
{
  "allOf": [
    {
      "$ref": "#/definitions/ContactInput"
    },
    {
      "properties": {
        "first_name": {
          "type": "string"
        },
        "icon_url": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      }
    }
  ]
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Addon

GET /addons

Get all Addons available to the current Team.

200 OK

Addon response

default

Unexpected error

Response Example (200 OK)
[
  {
    "author": "string",
    "description": "string",
    "homepage": "string",
    "id": "integer(int64)",
    "name": "string",
    "open": "boolean",
    "user_id": "integer(int64)"
  }
]
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

AddonInstall

GET /addon_installs

Get all Addons installed by the current Team that the authenticated User has access to.

200 OK

Addon response

default

Unexpected error

Response Example (200 OK)
[
  {
    "author": "string",
    "description": "string",
    "homepage": "string",
    "id": "integer(int64)",
    "name": "string",
    "open": "boolean",
    "user_id": "integer(int64)"
  }
]
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Session

Login

POST /sessions

This method handles users who are \ authenticating with an email and password combination.

UserCredentials response

Request Example
{
  "email": "string",
  "password": "string"
}
200 OK

User response

default

Unexpected error

Response Example (200 OK)
{
  "dob": "string",
  "email": "string",
  "first_name": "string",
  "icon_url": "string",
  "id": "integer(int64)",
  "last_name": "string",
  "phone": "string",
  "status": "string"
}
Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Logout

DELETE /sessions

This method destroys the current user session.

200 OK

Success response

default

Unexpected error

Response Example (default )
{
  "code": "integer(int32)",
  "message": "string"
}

Models

Account: object

id: object
type: object
location_id: object
display_name: object
title: object
icon_url: object

Addon: object

id: object
user_id: object
name: object
description: object
author: object
homepage: object
open: object

Address: object

address_line1: string
address_line2: string
address_city: string
address_postcode: string
address_state: string
country_id: string

Chat: object

id: object
owner_id: object
team_id: object
title: object
open: object
users: object

ChatInitiateInput: object

Array on user IDs to initiate the chat with.

user_ids: object

Contact:

first_name: string
last_name: string
icon_url: string

ContactInput: object

A representation of a Contact

id: object
owner_id: object
user_id: object
team_id: object
order: object
favorite: object
status: object
group: object

Error: object

code: object
message: object

Message:

id: integer (int64)
chat_title: string
sender_first_name: string
sender_last_name: string
sender_icon_url: string

MessageInput: object

chat_id: object
sender_id: object
receiver_id: object
message: object
kind: object
send_at: object
created_at: object

Team: object

A representation of an Team

id: integer (int64)
owner_id: integer (int64)
name: string
icon_url: string
email: string
phone: string

TeamMember: object

A representation of an TeamMember

id: integer (int64)
user_id: integer (int64)
team_id: integer (int64)
status: string
icon_url: string

User: object

A representation of a User

id: object
status: object
first_name: object
last_name: object
email: object
phone: object
dob: object
icon_url: object

UserCredentials: object

User login credentials

email: object
password: object

UserInput:

password: string