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
api_key
User
GET
/user
Get the current user object.
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"
}
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.
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 the current user account.
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
Update the current user account. \
The current account may be a User
, Team
, or TeamMember
type.
(no description)
(no description)
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"
}
}
}
]
}
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.
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
Confirm a user account using the given confirmation token.
(no description)
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.
(no description)
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
(no description)
Request Example
{
"dob": "string",
"email": "string",
"first_name": "string",
"icon_url": "string",
"id": "integer(int64)",
"last_name": "string",
"phone": "string",
"status": "string"
}
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
This method handles users who are \ authenticating with an email and password combination.
UserCredentials response
Request Example
{
"email": "string",
"password": "string"
}
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
This method destroys the current user session.
Success response
Unexpected error
Response Example (default )
{
"code": "integer(int32)",
"message": "string"
}
Account
Get the current account
Get the current user account.
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
Update the current user account. \
The current account may be a User
, Team
, or TeamMember
type.
(no description)
(no description)
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
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"
}
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 all chat rooms.
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
Get or create a chat room with multiple given users.
ChatInitiateInput response
Request Example
{
"user_ids": "array"
}
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 a single chat object by it's ID.
(no description)
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
Update a single chat object.
Chat response
(no description)
Request Example
{
"id": "integer(int64)",
"open": "boolean",
"owner_id": "integer(int64)",
"team_id": "integer(int64)",
"title": "string",
"users": "array"
}
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 all messages belonging to the given chat.
(no description)
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 all users participating in the given chat.
(no description)
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)"
}
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 recent chat messages for the current account scope.
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)"
}
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.
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 a single contact object by it's ID.
(no description)
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
Update a single contact object.
Contact response
(no description)
Request Example
{
"allOf": [
{
"$ref": "#/definitions/ContactInput"
},
{
"properties": {
"first_name": {
"type": "string"
},
"icon_url": {
"type": "string"
},
"last_name": {
"type": "string"
}
}
}
]
}
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.
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.
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
This method handles users who are \ authenticating with an email and password combination.
UserCredentials response
Request Example
{
"email": "string",
"password": "string"
}
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
This method destroys the current user session.
Success response
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
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
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