GithubHelp home page GithubHelp logo

paultaykalo / api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scalus/api

0.0 2.0 0.0 134 KB

The best way to get work done and keep people in sync.

Home Page: http://www.scalus.com

Ruby 14.01% JavaScript 64.54% CSS 16.40% HTML 5.05%

api's Introduction

Scalus's API

HOST: https://api.scalus.com/api/external/

Scalus's API allows developers to create tasks within the scalus ecosystem.

###################################################################
#  A Topic is a superclass that all Communications inherit from
#
#  A Communication Channel will accept a number of organizations_topics it wants communications for.
#    eg.  A mobile Device will by default want to hear all communications.
#         If the device adds a filter (NotificationFilter) they will not accept communications for
#         That type of message.
#
#  --------------                                --------------                ------------------
#  |  Org       |                                |Organizations|              |     Topic      |
#  |            |-------------------------------<| Topic      |>--------------|                |
#  |            |                                |            |               | medium         |
#  |            |                                |            |               | message_type   |
#  |            |                                |            |               | type           |
#  |            |                                |            |               | name           |
#  |            |                                |            |               | description    |
#  --------------                                --------------                ------------------
#        |                                             |
#        |                                             |
#       / \                                           / \
#  --------------        ------------------        ------------------
#  |  User      |        | Communication  |        |  Notification  |
#  |            |-------<| Channel        |-------<|  Filters       |
#  |            |        |                |        |                |
#  |            |        | type           |        |                |
#  |            |        | name           |        |                |
#  |            |        | meta           |        |                |
#  |            |        | options        |        |                |
#  |            |        | -------------  |        |                |
#  |            |        | medium (email) |        |                |
#  --------------        ------------------        ------------------
#
###################################################################
###################################################################
#
#  --------------         --------------                ------------------
#  |  Org       |         | Tasklist   |               |     Topic      |
#  |            |         |            |>--------------|                |
#  |            |         | title      |               | medium         |
#  |            |         |            |               | message_type   |
#  |            |         |            |               | type           |
#  |            |    /---<|            |               | name           |
#  |            |   /     |            |               | description    |
#  --------------  /      --------------                ------------------
#        |        /             |                  ------------------------
#        |       /              |                  |   Team               |
#        |      /               |                  |sorta like a client   |
#       / \    /               / \                 |or company that can't |
#  --------------        ------------------        |see your work but you |
#  |  User      |        | Task           |>-------|interact with them    |
#  |            |-------<|                |        ------------------------
#  |            |        |                |        |  Activity      |
#  |            |        | title          |-------<|  Items         |
#  |            |        | status         |        |                |
#  |            |        | due_date       |        |                |
#  |            |        |                |        ------------------
#  |            |        |                |        ------------------
#  |            |        |                |-------<|   Labels       |
#  --------------        ------------------        |                |
#                                 |                |                |
#                                / \               ------------------
#                        ------------------
#                        |   Messages     |
#                        |                |
#                        |                |
#                        ------------------
###################################################################

Overview

  • All requests must set the accept header to include the 'Content-Type' headers to "application/vnd.api+json"
  • The version of the API must be set in the Accept headers (currently version=1 is the only option).
  • Endpoints generally follow the jsonapi specifications. http://jsonapi.org
  • If an endpoint has a relationship that you would like to be side-loaded you can use "include=relationship" in the query params for the GET request. EX. GET /api/external/tasks/1?include=messages

Look at our glossary: http://help.scalus.com/support/solutions/articles/5000541650-glossary

Activity Items

Activity Items the user is involved with.

paginated with the offset not the page number

Parameter Description
event_type brief word that describes what triggered the change
event_source where the event was triggered (api, auto, email, webform)
from original value
to new value
secondary_attribute ...
target_title this is the source's title if the source that changed has a title
attribute_name attribute that changed
related models
user
activity_item

GET Activity Items

GET https://api.scalus.com/api/external/activity_items

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/activity_items', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  [{"id"=>"9",
    "type"=>"activity_items",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/activity_items/9"},
    "attributes"=>
     {"event_type"=>"task_created",
      "event_source"=>"webform",
      "from"=>nil,
      "to"=>nil,
      "created_at"=>"2016-01-19T17:08:20-08:00",
      "secondary_attribute"=>nil,
      "target_title"=>nil,
      "attribute_name"=>nil},
    "relationships"=>
     {"activity_itemable"=>
       {"links"=>
         {"self"=>
           "https://api.scalus.com/api/external/v1/activity_items/9/relationships/activity_itemable",
          "related"=>
           "https://api.scalus.com/api/external/v1/activity_items/9/activity_itemable"}}}},
   {"id"=>"7",
    "type"=>"activity_items",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/activity_items/7"},
    "attributes"=>
     {"event_type"=>"task_created",
      "event_source"=>"webform",
      "from"=>nil,
      "to"=>nil,
      "created_at"=>"2016-01-19T17:08:20-08:00",
      "secondary_attribute"=>nil,
      "target_title"=>nil,
      "attribute_name"=>nil},
    "relationships"=>
     {"activity_itemable"=>
       {"links"=>
         {"self"=>
           "https://api.scalus.com/api/external/v1/activity_items/7/relationships/activity_itemable",
          "related"=>
           "https://api.scalus.com/api/external/v1/activity_items/7/activity_itemable"}}}}],
 "links"=>
  {"first"=>
    "https://api.scalus.com/api/external/v1/activity_items?page%5Blimit%5D=20&page%5Boffset%5D=0",
   "last"=>
    "https://api.scalus.com/api/external/v1/activity_items?page%5Blimit%5D=20&page%5Boffset%5D=0"}}

GET Activity Item

GET https://api.scalus.com/api/external/activity_items/:id

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/activity_items/4', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"activity_items",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/activity_items/4"},
   "attributes"=>
    {"event_type"=>"task_created",
     "event_source"=>"webform",
     "from"=>nil,
     "to"=>nil,
     "created_at"=>"2016-01-19T17:13:45-08:00",
     "secondary_attribute"=>nil,
     "target_title"=>nil,
     "attribute_name"=>nil},
   "relationships"=>
    {"activity_itemable"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/activity_items/4/relationships/activity_itemable",
         "related"=>
          "https://api.scalus.com/api/external/v1/activity_items/4/activity_itemable"}}}}}

Communication Channels

A communication Channel represents any form of communication that Scalus can contact a user. Ex. Email Channel, Mobile Channel, Slack Channel.

Parameter Description Examples
name The name the user has given to their contact info "Primary Email"
"My Primary Phone"
identifier The value of the channels contact info john.doe@my_email.com
315-555-1234
identifier_name name of what the identifier represents "email"
"number"
Types of Channels
email_channels
mobile_channels

GET Communication Channels

GET https://api.scalus.com/api/external/communication_channels

Returns all the Communication Channels related to the currently logged in user.

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/communication_channels
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/communication_channels', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  [{"id"=>"7",
    "type"=>"email_channels",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/email_channels/7"},
    "attributes"=>
     {"name"=>"my best contact",
      "identifier"=>"[email protected]",
      "identifier_name"=>"email"}},
   {"id"=>"9",
    "type"=>"email_channels",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/email_channels/9"},
    "attributes"=>
     {"name"=>"My email",
      "identifier"=>"[email protected]",
      "identifier_name"=>"email"}}],
 "links"=>
  {"first"=>
    "https://api.scalus.com/api/external/v1/communication_channels?page%5Bnumber%5D=1&page%5Bsize%5D=20",
   "last"=>
    "https://api.scalus.com/api/external/v1/communication_channels?page%5Bnumber%5D=1&page%5Bsize%5D=20"}}

GET Communication Channel

GET https://api.scalus.com/api/external/communication_channels/:id

Returns a specific Communication Channel related to the currently logged in user.

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/communication_channels/4
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/communication_channels/4', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"email_channels",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/email_channels/4"},
   "attributes"=>
    {"name"=>"My business Email",
     "identifier"=>"[email protected]",
     "identifier_name"=>"email"
    }
  }
}

POST Email Channel

POST https://api.scalus.com/api/email_channels

Creates a Email Channel related to the currently logged in user.

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X POST https://api.scalus.com/api/external/email_channels
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/email_channels/4', {
  access_token: 'YOUR_ACCESS_TOKEN'
  "data"=>
    { id: 4,
      type: 'email_channels',
     "attributes"=>
      {
       "name"=>"My personal email",
       "email"=>"[email protected]"
      }
    }

}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"email_channels",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/email_channels/4"},
   "attributes"=>
    {"name"=>"My personal email",
     "identifier"=>"[email protected]",
     "identifier_name"=>"number"
    }
  }
}

POST Mobile Channel

POST https://api.scalus.com/api/mobile_channels

Creates a Mobile Channel related to the currently logged in user.

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X POST https://api.scalus.com/api/external/mobile_channels
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/mobile_channels/4', {
  access_token: 'YOUR_ACCESS_TOKEN'
  "data"=>
    { id: 4,
      type: 'mobile_channels',
     "attributes"=>
      {"name"=>"My cell Phone",
       "number"=>"315-555-1234"
      }
    }

}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"mobile_channels",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/mobile_channels/4"},
   "attributes"=>
    {"name"=>"My cell Phone",
     "identifier"=>"315-555-1234",
     "identifier_name"=>"number"
    }
  }
}

DELETE Communication Channel

DELETE https://api.scalus.com/api/external/communication_channels/:id

Inactivates a specific Communication Channel related to the currently logged in user. After you inactivate a channel it will no longer receive notifications.

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/communication_channels/8', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"8",
   "type"=>"email_channels",
   "links"=>{"self"=>"/api/external/v1/email_channels/8"},
   "attributes"=>
    {"name"=>"My Personal email",
     "identifier"=>"[email protected]",
     "identifier_name"=>"email",
     "active"=>false
    }
  }
}

File Uploads

File uploads happen in a two set process. The first step a file is uploaded and a token is returned as a responce. Using the token_id returned in the responce. The file can then be attached to a message.

You can attach files of the following format to a task: PDF, JPG, PNG, .xls, .xlsx, .doc, .docx, and .txt

POST File Upload

POST https://api.scalus.com/api/external/file_uploads

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.post 'https://api.scalus.com/api/external/file_uploads', {
  access_token: 'YOUR_ACCESS_TOKEN',
  content_type: 'image/jpeg'
  file_upload:  { doc: File.new("/path/to/test.jpg", 'rb') }
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"file_attachments",
   "links"=>{"self"=>"/api/external/v1/file_attachments/4"},
   "attributes"=>
    {"doc_content_type"=>"image/jpg",
     "doc_file_name"=>"test.jpg",
     "token_id"=>
      "SGlCMkx6b2FDMHVnMEdJaXhCVUxnb3dHMzZHdTVZdXNITUtUL0hZOXVLcz0tLWJER25MM1pPMWJZWlNVUDlpa2RwM3c9PQ==--4cd8b53da6b12a7b5ec5e6afa83af33d2f84f34e",
     "display_file_size"=>"1.75 KB",
     "doc_url"=>
      "https://s3.amazonaws.com/backops-dev/docs/4/test.jpg?1452287068"
    }
  }
}

now to attach the file to a comment do the following

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.post 'https://api.scalus.com/api/external/messages', {
  access_token: 'YOUR_ACCESS_TOKEN',
  data: {
    type: 'messages',
    attributes: {
      body:         'Sample Comment from Attributes',
      internal:     'false',
      file_tokens:  ['SGlCMkx6b2FDMHVnMEdJaXhCVUxnb3dHMzZHdTVZdXNITUtUL0hZOXVLcz0tLWJER25MM1pPMWJZWlNVUDlpa2RwM3c9PQ==--4cd8b53da6b12a7b5ec5e6afa83af33d2f84f34e'],
      external_emails: ['[email protected]', '[email protected]']
    }
  }
}

Labels

A tag to group similar tasks or tasklists together to allow for easier searching in the future.

Parameter Description
name The name the label

GET Labels

GET https://api.scalus.com/api/external/labels

Returns all the Labels related to the firm of the logged in user.

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/labels
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/labels', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  [{"id"=>"13",
    "type"=>"labels",
    "links"=>{"self"=>"http://firm-9.scalus.com/api/external/v1/labels/13"},
    "attributes"=>{"name"=>"one", "status"=>"active"}},
   {"id"=>"14",
    "type"=>"labels",
    "links"=>{"self"=>"http://firm-9.scalus.com/api/external/v1/labels/14"},
    "attributes"=>{"name"=>"two", "status"=>"active"}}],
 "links"=>
  {"first"=>
    "http://firm-9.scalus.com/api/external/v1/labels?page%5Bnumber%5D=1&page%5Bsize%5D=20",
   "last"=>
    "http://firm-9.scalus.com/api/external/v1/labels?page%5Bnumber%5D=1&page%5Bsize%5D=20"
  }
}

GET Label

GET https://api.scalus.com/api/external/labels/:id

Returns a specific label related to the firm of the logged in user.

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/labels/4
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/labels/4', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"labels",
   "links"=>{"self"=>"http://firm-3.scalus.com/api/external/v1/labels/4"},
   "attributes"=>{"name"=>"Urgent", "status"=>"active"}
  }
}

POST Label

POST https://api.scalus.com/api/labels

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X POST https://api.scalus.com/api/external/labels
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.post 'https://api.scalus.com/api/external/labels', {
  access_token: 'YOUR_ACCESS_TOKEN',
  data: {
    type: 'labels',
    attributes: {
      name: 'Low Priority'
    }
  }
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"labels",
   "links"=>{"self"=>"http://firm-3.scalus.com/api/external/v1/labels/4"},
   "attributes"=>{"name"=>"Low Priority", "status"=>"active"}
  }
}

PUT Label

PUT https://api.scalus.com/api/labels/:id

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X PUT https://api.scalus.com/api/external/labels/4
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.put 'https://api.scalus.com/api/external/labels/4', {
  access_token: 'YOUR_ACCESS_TOKEN',
  data: {
    type: 'labels',
    attributes: {
      name: 'Zero Priority'
    }
  }
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"labels",
   "links"=>{"self"=>"http://firm-3.scalus.com/api/external/v1/labels/4"},
   "attributes"=>{"name"=>"Zero Priority", "status"=>"active"}
  }
}

DELETE Label

DELETE https://api.scalus.com/api/external/labels/:id

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.delete 'https://api.scalus.com/api/external/labels/4', {
  access_token: 'YOUR_ACCESS_TOKEN',
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"labels",
   "links"=>{"self"=>"/api/external/v1/labels/4"},
   "attributes"=>{"name"=>"one", "status"=>"deleted"}}}

Messages

Messages are appended to a task so users can communicate with each other.

Parameter Description
body text of the comment to display
body_markup simple HTML markup of the comment to display
internal Boolean set to true if the message is only for messages that can only be seen by those within your organization
created_at timestamp when the message was created
related models
creator (user)
task

Internal Messages

Internal messages on tasks can only be seen by those within your organization. They can not be seen by external team members or Third Party Email team members.

GET https://api.scalus.com/api/external/messages?filter[internal]=true

External Messages

Messages marked as external (and highlighted green) are the only messaged that can be seen by External Team Members and Third Party Email team members

GET Messages

GET https://api.scalus.com/api/external/messages?filter[internal]=false

Returns all the Messages related to the task

curl
-F access_token="YOUR_ACCESS_TOKEN"
-F task_id=12
-X GET https://api.scalus.com/api/external/messages
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/messages/?task_id=12', {
  access_token: 'YOUR_ACCESS_TOKEN',
  filter: { internal: 'false'}
}

The above command returns JSON structured like this:

{"data"=>
  [{"id"=>"3",
    "type"=>"messages",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/messages/3"},
    "attributes"=>
     {"body"=>"Yabba Dabba Do",
      "body_markup"=>"<p>Yabba Dabba Do</p>",
      "internal"=>false,
      "created_at"=>"2016-01-07T14:16:25-08:00"},
    "relationships"=>
     {"creator"=>
       {"links"=>
         {"self"=>
           "https://api.scalus.com/api/external/v1/messages/3/relationships/creator",
          "related"=>"https://api.scalus.com/api/external/v1/messages/3/creator"}},
      "task"=>
       {"links"=>
         {"self"=>
           "https://api.scalus.com/api/external/v1/messages/3/relationships/task",
          "related"=>"https://api.scalus.com/api/external/v1/messages/3/task"}}}},
   {"id"=>"2",
    "type"=>"messages",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/messages/2"},
    "attributes"=>
     {"body"=>"Is That you Fred?",
      "body_markup"=>"<p>Is That you Fred?</p>",
      "internal"=>false,
      "created_at"=>"2016-01-07T14:16:25-08:00"},
    "relationships"=>
     {"creator"=>
       {"links"=>
         {"self"=>
           "https://api.scalus.com/api/external/v1/messages/2/relationships/creator",
          "related"=>"https://api.scalus.com/api/external/v1/messages/2/creator"}},
      "task"=>
       {"links"=>
         {"self"=>
           "https://api.scalus.com/api/external/v1/messages/2/relationships/task",
          "related"=>"https://api.scalus.com/api/external/v1/messages/2/task"}}}}],
 "links"=>
  {"first"=>
    "https://api.scalus.com/api/external/v1/messages?page%5Bnumber%5D=1&page%5Bsize%5D=20",
   "last"=>
    "https://api.scalus.com/api/external/v1/messages?page%5Bnumber%5D=1&page%5Bsize%5D=20"
  }
}

GET Message

GET https://api.scalus.com/api/external/messages/:id

curl
-F access_token="YOUR_ACCESS_TOKEN"
-F task_id=12
-X GET https://api.scalus.com/api/external/messages/32
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/messages/32/?task_id=12', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"32",
   "type"=>"messages",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/messages/32"},
   "attributes"=>
    {"body"=>"Is That you Fred?",
     "body_markup"=>"<p>Is That you Fred?</p>",
     "internal"=>false,
     "created_at"=>"2016-01-07T14:27:54-08:00"},
   "relationships"=>
    {"creator"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/messages/32/relationships/creator",
         "related"=>"https://api.scalus.com/api/external/v1/messages/32/creator"}},
     "task"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/messages/32/relationships/task",
         "related"=>"https://api.scalus.com/api/external/v1/messages/32/task"
        }
      }
    }
  }
}

POST Message

POST https://api.scalus.com/api/external/messages/:id

NOTE: If you need to attach a file, first you need to create a token_id as shown in file uploads

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.post 'https://api.scalus.com/api/external/messages', {
  access_token: 'YOUR_ACCESS_TOKEN',
  data: {
    type: 'messages',
    attributes: {
      body:         'Sample Comment from Attributes',
      internal:     'false',
      file_tokens:  ['SGlCMkx6b2FDMHVnMEdJaXhCVUxnb3dHMzZHdTVZdXNITUtUL0hZOXVLcz0tLWJER25MM1pPMWJZWlNVUDlpa2RwM3c9PQ==--4cd8b53da6b12a7b5ec5e6afa83af33d2f84f34e'],
      external_emails: ['[email protected]', '[email protected]']
    }
  }
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"32",
   "type"=>"messages",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/messages/32"},
   "attributes"=>
    {"body"=>"Is That you Fred?",
     "body_markup"=>"<p>Is That you Fred?</p>",
     "internal"=>false,
     "created_at"=>"2016-01-07T14:27:54-08:00"},
   "relationships"=>
    {"creator"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/messages/32/relationships/creator",
         "related"=>"https://api.scalus.com/api/external/v1/messages/32/creator"}},
     "task"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/messages/32/relationships/task",
         "related"=>"https://api.scalus.com/api/external/v1/messages/32/task"
        }
      }
    }
  }
}

Notification Filters

Parameter Description
name Name of the topic to be filtered
message_type type of message being sent (Ex. message_added)
medium The communication medium (Ex. email or mobile)
topic_id UID of the topic being filtered
related models
organizations_topic
communication_channel

GET Notification Filters

GET https://api.scalus.com/api/external/notification_filters

Returns all the Notification Filters related to the logged in user.

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/notification_filters
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/notification_filters', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  [{"id"=>"1",
    "type"=>"notification_filters",
    "links"=>
     {"self"=>"https://api.scalus.com/api/external/v1/notification_filters/1"},
    "attributes"=>
     {"topic_id"=>1,
      "medium"=>"email",
      "message_type"=>"message_added",
      "name"=>"Message Added"},
    "relationships"=>
     {"organizations_topic"=>
       {"links"=>
         {"self"=>
           "https://api.scalus.com/api/external/v1/notification_filters/1/relationships/organizations_topic",
          "related"=>
           "https://api.scalus.com/api/external/v1/notification_filters/1/organizations_topic"}},
      "communication_channel"=>
       {"links"=>
         {"self"=>
           "https://api.scalus.com/api/external/v1/notification_filters/1/relationships/communication_channel",
          "related"=>
           "https://api.scalus.com/api/external/v1/notification_filters/1/communication_channel"}}}},
   {"id"=>"2",
    "type"=>"notification_filters",
    "links"=>
     {"self"=>"https://api.scalus.com/api/external/v1/notification_filters/2"},
    "attributes"=>
     {"topic_id"=>10,
      "medium"=>"mobile",
      "message_type"=>"task_ready",
      "name"=>"Task Ready"},
    "relationships"=>
     {"organizations_topic"=>
       {"links"=>
         {"self"=>
           "https://api.scalus.com/api/external/v1/notification_filters/2/relationships/organizations_topic",
          "related"=>
           "https://api.scalus.com/api/external/v1/notification_filters/2/organizations_topic"}},
      "communication_channel"=>
       {"links"=>
         {"self"=>
           "https://api.scalus.com/api/external/v1/notification_filters/2/relationships/communication_channel",
          "related"=>
           "https://api.scalus.com/api/external/v1/notification_filters/2/communication_channel"}}}}],
 "links"=>
  {"first"=>
    "https://api.scalus.com/api/external/v1/notification_filters?page%5Bnumber%5D=1&page%5Bsize%5D=20",
   "last"=>
    "https://api.scalus.com/api/external/v1/notification_filters?page%5Bnumber%5D=1&page%5Bsize%5D=20"
  }
}

POST Notification Filter

POST https://api.scalus.com/api/external/notification_filters

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.post 'https://api.scalus.com/api/external/notification_filters', {
  access_token: 'YOUR_ACCESS_TOKEN',
   topic_id: 10,
   communication_channel_id: 2
}

DELETE Notification Filter

DELETE https://api.scalus.com/api/notification_filters/:id

Organization's Topics

Organization's Topics are representations of the types of communications that can possibly be sent to users.

  • Ex1. Scalus can send an email when a message is added to a topic.
  • Ex2. Scalus can notify a mobile device when a message is added to a topic.
Parameter Description
name Name of the topic to be filtered
message_type type of message being sent (Ex. message_added)
medium The communication medium (Ex. email or mobile)
description description of the topic
topic_id UID of the topic being filtered

GET Organization's Topics

GET https://api.scalus.com/api/external/organizations_topics

Returns all the Organization's Topics related to the firm of the logged in user.

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/organizations_topics
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/organizations_topics', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  [{"id"=>"4",
    "type"=>"organizations_topics",
    "links"=>
     {"self"=>"https://api.scalus.com/api/external/v1/organizations_topics/4"},
    "attributes"=>
     {"name"=>"Message Added",
      "medium"=>"email",
      "message_type"=>"message_added",
      "description"=>
       "Send notification to email when a message is added to a task that I follow.",
      "topic_id"=>1}},
   {"id"=>"8",
    "type"=>"organizations_topics",
    "links"=>
     {"self"=>"https://api.scalus.com/api/external/v1/organizations_topics/8"},
    "attributes"=>
     {"name"=>"Task Ready",
      "medium"=>"mobile",
      "message_type"=>"task_ready",
      "description"=>
       "Send notification to device when a task made ready to work on and is assigned to me",
      "topic_id"=>10}}],
 "links"=>
  {"first"=>
    "https://api.scalus.com/api/external/v1/organizations_topics?page%5Bnumber%5D=1&page%5Bsize%5D=20",
   "last"=>
    "https://api.scalus.com/api/external/v1/organizations_topics?page%5Bnumber%5D=1&page%5Bsize%5D=20"
  }
}

GET Organization's Topic

GET https://api.scalus.com/api/external/organizations_topics/:id

Returns a specific Organization's Topic related to the firm of the logged in user.

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/organizations_topics/4
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/organizations_topics/4', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"organizations_topics",
   "links"=>
    {"self"=>"https://api.scalus.com/api/external/v1/organizations_topics/4"},
   "attributes"=>
    {"name"=>"Message Added",
     "medium"=>"email",
     "message_type"=>"message_added",
     "description"=>
      "Send notification to email when a message is added to a task that I follow.",
     "topic_id"=>1
    }
  }
}

Tasks

A task is the basic unit in the Scalus workflow. It serves both as a reminder of work that your workers need to complete, as well as a collector for all activity and communication about completing the task.

Query Parameters

Parameter Required Description
title true The title of the task
requester_id false ID of the User that requested the task
assignee_id false ID of the User that is assigned the task
due_date false Date that the task is due
team_id false The ID of the team associated to the task
status true The status of the task (not_started, in_progress, resolved)
created_at --- created at
updated_at --- updated at
You must replace organization\_slug with your personal slug. (your subdomain in scalus is your organization\_slug)
Additional Attributes Description
last_message text that represents the last message added to the task (this allows you to not sideload all messages on a task)
tasklist This tasklist associated to the task (this can be nil) A tasklist groups many tasks for organizing into a group. Think of it like a "project" that holds many tasks.
team A team is very much like a client.
followers The users that are "following" a task. These users will generally be notified about information about a task if specific activity_items happen
labels It is what it sounds like
activity_items Events that can happen within a task. EX. "add a message to a task", "change status (to complete)", "Change the title", "add a label", "set due date", "remove yourself as a follower"
messages Think of this as a comment on a task. We call this "a message" rather than "a comment"

URL Parameters

Parameter Description
ID The ID of the task to retrieve

GET Tasks

GET https://api.scalus.com/api/external/tasks

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/tasks
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/tasks', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

qwerty

The above command returns JSON structured like this:

{"data"=>
  [{"id"=>"3",
   "type"=>"tasks",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/tasks/3"},
   "attributes"=>
    {"title"=>"Sample Task2",
     "created_at"=>"2016-02-09T13:02:12-08:00",
     "updated_at"=>"2016-02-09T13:02:12-08:00",
     "due_date"=>"2016-02-10",
     "last_message"=>nil,
     "team_id"=>7,
     "assignee_id"=>8,
     "requester_id"=>9,
     "status"=>"not_started"},
   "relationships"=>
    {"assignee"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/assignee",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/assignee"},
       "data"=>{"type"=>"users", "id"=>"8"}},
     "creator"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/creator",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/creator"},
       "data"=>{"type"=>"users", "id"=>"10"}},
     "requester"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/requester",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/requester"},
       "data"=>{"type"=>"users", "id"=>"9"}},
     "tasklist"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/tasklist",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/tasklist"}},
     "team"=>
      {"links"=>
        {"self"=>"https://api.scalus.com/api/external/v1/tasks/3/relationships/team",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/team"},
       "data"=>{"type"=>"teams", "id"=>"7"}},
     "followers"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/followers",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/followers"}},
     "labels"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/labels",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/labels"}},
     "activity_items"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/activity_items",
         "related"=>
          "https://api.scalus.com/api/external/v1/tasks/3/activity_items"}},
     "messages"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/messages",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/messages"}}}},
 "included"=>
  [{"id"=>"8",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/8"},
    "attributes"=>
     {"first_name"=>"Elise",
      "last_name"=>"Fay",
      "email"=>"[email protected]",
      "kind"=>"firm",
      "status"=>"active"}},
   {"id"=>"10",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/10"},
    "attributes"=>
     {"first_name"=>"John",
      "last_name"=>"Doe",
      "email"=>"[email protected]",
      "kind"=>"other",
      "status"=>"active"}},
   {"id"=>"9",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/9"},
    "attributes"=>
     {"first_name"=>"Theodora",
      "last_name"=>"Schiller",
      "email"=>"[email protected]",
      "kind"=>"firm",
      "status"=>"active"}
    }]
  ]
}

GET Task

GET https://api.scalus.com/api/external/tasks/:id

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/tasks/19
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/tasks/3', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"3",
   "type"=>"tasks",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/tasks/3"},
   "attributes"=>
    {"title"=>"Sample Task2",
     "created_at"=>"2016-02-09T13:02:12-08:00",
     "updated_at"=>"2016-02-09T13:02:12-08:00",
     "due_date"=>"2016-02-10",
     "last_message"=>nil,
     "team_id"=>7,
     "assignee_id"=>8,
     "requester_id"=>9,
     "status"=>"not_started"},
   "relationships"=>
    {"assignee"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/assignee",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/assignee"},
       "data"=>{"type"=>"users", "id"=>"8"}},
     "creator"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/creator",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/creator"},
       "data"=>{"type"=>"users", "id"=>"10"}},
     "requester"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/requester",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/requester"},
       "data"=>{"type"=>"users", "id"=>"9"}},
     "tasklist"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/tasklist",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/tasklist"}},
     "team"=>
      {"links"=>
        {"self"=>"https://api.scalus.com/api/external/v1/tasks/3/relationships/team",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/team"},
       "data"=>{"type"=>"teams", "id"=>"7"}},
     "followers"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/followers",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/followers"}},
     "labels"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/labels",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/labels"}},
     "activity_items"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/activity_items",
         "related"=>
          "https://api.scalus.com/api/external/v1/tasks/3/activity_items"}},
     "messages"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/messages",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/messages"}}}},
 "included"=>
  [{"id"=>"8",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/8"},
    "attributes"=>
     {"first_name"=>"Elise",
      "last_name"=>"Fay",
      "email"=>"[email protected]",
      "kind"=>"firm",
      "status"=>"active"}},
   {"id"=>"10",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/10"},
    "attributes"=>
     {"first_name"=>"John",
      "last_name"=>"Doe",
      "email"=>"[email protected]",
      "kind"=>"other",
      "status"=>"active"}},
   {"id"=>"9",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/9"},
    "attributes"=>
     {"first_name"=>"Theodora",
      "last_name"=>"Schiller",
      "email"=>"[email protected]",
      "kind"=>"firm",
      "status"=>"active"}}]}

This endpoint retreives a specific task if the user is authorized.

If you request a task that is not in your organization or the logged in user does not have permissions to see the task, the response will return 422 Unprocessable Entity.

PUT Task

PUT https://api.scalus.com/api/external/tasks/:id

Definition PUT /api/tasks/:id

Example Request

curl
-F id="22" \
-F type="tasks" \
-F task[title]="Thank you for looking at our API" \
-F task[requester_id]=1 \
-F task[assignee_id]=1 \
-F task[due_date]="10-25-2021" \
-F access_token="YOUR_ACCESS_TOKEN"
-X POST https://api.scalus.com/api/external/tasks/22
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.put 'https://api.scalus.com/api/external/tasks/22', {
  access_token: 'YOUR_ACCESS_TOKEN',
  "id": 22,
  "type": "tasks",
  "task": {
    "title":        "Thank you for looking at our API, a second time",
    "requester_id": 1,
    "assignee_id":  2,
    "due_date":     "10-25-2021",
    "team_id":      7,
    "status":       "not_started"
  }
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"3",
   "type"=>"tasks",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/tasks/3"},
   "attributes"=>
    {"title"=>"Thank you for looking at our API, a second time",
     "created_at"=>"2016-02-09T13:02:12-08:00",
     "updated_at"=>"2016-02-09T13:02:12-08:00",
     "due_date"=>"2021-10-25",
     "last_message"=>nil,
     "team_id"=>7,
     "assignee_id"=>2,
     "requester_id"=>1,
     "status"=>"not_started"},
   "relationships"=>
    {"assignee"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/assignee",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/assignee"},
       "data"=>{"type"=>"users", "id"=>"8"}},
     "creator"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/creator",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/creator"},
       "data"=>{"type"=>"users", "id"=>"10"}},
     "requester"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/requester",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/requester"},
       "data"=>{"type"=>"users", "id"=>"9"}},
     "tasklist"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/tasklist",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/tasklist"}},
     "team"=>
      {"links"=>
        {"self"=>"https://api.scalus.com/api/external/v1/tasks/3/relationships/team",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/team"},
       "data"=>{"type"=>"teams", "id"=>"7"}},
     "followers"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/followers",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/followers"}},
     "labels"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/labels",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/labels"}},
     "activity_items"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/activity_items",
         "related"=>
          "https://api.scalus.com/api/external/v1/tasks/3/activity_items"}},
     "messages"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/messages",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/messages"}}}},
 "included"=>
  [{"id"=>"8",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/8"},
    "attributes"=>
     {"first_name"=>"Elise",
      "last_name"=>"Fay",
      "email"=>"[email protected]",
      "kind"=>"firm",
      "status"=>"active"}},
   {"id"=>"10",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/10"},
    "attributes"=>
     {"first_name"=>"John",
      "last_name"=>"Doe",
      "email"=>"[email protected]",
      "kind"=>"other",
      "status"=>"active"}},
   {"id"=>"9",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/9"},
    "attributes"=>
     {"first_name"=>"Theodora",
      "last_name"=>"Schiller",
      "email"=>"[email protected]",
      "kind"=>"firm",
      "status"=>"active"}}]}

POST Task

POST https://api.scalus.com/api/external/tasks

Definition POST /api/external/tasks

Example Request

curl
-F type="tasks" \
-F task[title]="Thank you for looking at our API" \
-F task[requester_id]=1 \
-F task[assignee_id]=1 \
-F task[due_date]="10-25-2021" \
-F access_token="YOUR_ACCESS_TOKEN"
-X POST https://api.scalus.com/api/external/tasks
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.post 'https://api.scalus.com/api/external/tasks', {
  access_token: 'YOUR_ACCESS_TOKEN',
  "task": {
    "title": "Thank you for looking at our API",
    "requester_id": 1,
    "assignee_id": 3,
    "due_date": "2021-10-25",
    "team_id": 7
  }
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"3",
   "type"=>"tasks",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/tasks/3"},
   "attributes"=>
    {"title"=>"Thank you for looking at our API",
     "created_at"=>"2016-02-09T13:02:12-08:00",
     "updated_at"=>"2016-02-09T13:02:12-08:00",
     "due_date"=>"2021-10-25",
     "last_message"=>nil,
     "team_id"=>7,
     "assignee_id"=>8,
     "requester_id"=>1,
     "status"=>"not_started"},
   "relationships"=>
    {"assignee"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/assignee",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/assignee"},
       "data"=>{"type"=>"users", "id"=>"8"}},
     "creator"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/creator",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/creator"},
       "data"=>{"type"=>"users", "id"=>"10"}},
     "requester"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/requester",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/requester"},
       "data"=>{"type"=>"users", "id"=>"9"}},
     "tasklist"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/tasklist",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/tasklist"}},
     "team"=>
      {"links"=>
        {"self"=>"https://api.scalus.com/api/external/v1/tasks/3/relationships/team",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/team"},
       "data"=>{"type"=>"teams", "id"=>"7"}},
     "followers"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/followers",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/followers"}},
     "labels"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/labels",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/labels"}},
     "activity_items"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/activity_items",
         "related"=>
          "https://api.scalus.com/api/external/v1/tasks/3/activity_items"}},
     "messages"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/tasks/3/relationships/messages",
         "related"=>"https://api.scalus.com/api/external/v1/tasks/3/messages"}}}},
 "included"=>
  [{"id"=>"8",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/8"},
    "attributes"=>
     {"first_name"=>"Elise",
      "last_name"=>"Fay",
      "email"=>"[email protected]",
      "kind"=>"firm",
      "status"=>"active"}},
   {"id"=>"10",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/10"},
    "attributes"=>
     {"first_name"=>"John",
      "last_name"=>"Doe",
      "email"=>"[email protected]",
      "kind"=>"other",
      "status"=>"active"}},
   {"id"=>"9",
    "type"=>"users",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/users/9"},
    "attributes"=>
     {"first_name"=>"Theodora",
      "last_name"=>"Schiller",
      "email"=>"[email protected]",
      "kind"=>"firm",
      "status"=>"active"}}]}```

This endpoint creates a task.


<h2 id="deletetask"><span class='red-btn'>DELETE</span> Task</h2>

`DELETE https://api.scalus.com/api/external/tasks/:id`

```ruby
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.delete 'https://api.scalus.com/api/external/tasks/8', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"8",
   "type"=>"tasks",
   "links"=>{"self"=>"/api/external/v1/tasks/8"},
   "attributes"=>
    {"title"=>"Sample Task2",
     "created_at"=>"2016-01-19T14:30:33-08:00",
     "updated_at"=>"2016-01-19T14:30:34-08:00",
     "due_date"=>"2016-01-20",
     "last_message"=>nil,
     "team_id"=>2,
     "assignee_id"=>1,
     "requester_id"=>2,
     "status"=>"deleted"},
   "relationships"=>
    {"assignee"=>
      {"links"=>
        {"self"=>"/api/external/v1/tasks/8/relationships/assignee",
         "related"=>"/api/external/v1/tasks/8/assignee"}},
     "creator"=>
      {"links"=>
        {"self"=>"/api/external/v1/tasks/8/relationships/creator",
         "related"=>"/api/external/v1/tasks/8/creator"}},
     "requester"=>
      {"links"=>
        {"self"=>"/api/external/v1/tasks/8/relationships/requester",
         "related"=>"/api/external/v1/tasks/8/requester"}},
     "tasklist"=>
      {"links"=>
        {"self"=>"/api/external/v1/tasks/8/relationships/tasklist",
         "related"=>"/api/external/v1/tasks/8/tasklist"}},
     "team"=>
      {"links"=>
        {"self"=>"/api/external/v1/tasks/8/relationships/team",
         "related"=>"/api/external/v1/tasks/8/team"}},
     "followers"=>
      {"links"=>
        {"self"=>"/api/external/v1/tasks/8/relationships/followers",
         "related"=>"/api/external/v1/tasks/8/followers"}},
     "labels"=>
      {"links"=>
        {"self"=>"/api/external/v1/tasks/8/relationships/labels",
         "related"=>"/api/external/v1/tasks/8/labels"}},
     "activity_items"=>
      {"links"=>
        {"self"=>"/api/external/v1/tasks/8/relationships/activity_items",
         "related"=>"/api/external/v1/tasks/8/activity_items"}},
     "messages"=>
      {"links"=>
        {"self"=>"/api/external/v1/tasks/8/relationships/messages",
         "related"=>"/api/external/v1/tasks/8/messages"}}}}}

Reset Password

Pinging the endpoint will send the user an email that they can use to reset their password in the web app from.

Parameter type Description
email string email of the user that needs to reset their password in the organization
subdomain string subdomain of the organization that they want to reset their password.
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.post 'https://api.scalus.com/api/external/reset_passwords', {
  access_token: 'YOUR_ACCESS_TOKEN',
  email: '[email protected]',
  subdomain: 'yourORGANIZATIONSsubdomain'
}

The response will have a status code of 200 or 4XX depending on if it was successful

Teams

A group inside your Scalus organization made up of assigned team members

Parameter type Description
name string Name of the team in the organization
slug string unique ID representing the team (can not be updated) Also used in the support email for the team.

GET Teams

GET https://api.scalus.com/api/external/teams

Returns all the teams related to the firm of the logged in user.

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/teams
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/teams', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  [{"id"=>"1",
    "type"=>"teams",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/teams/1"},
    "attributes"=>{"name"=>"Company 1", "slug"=>"testacme1"}},
   {"id"=>"3",
    "type"=>"teams",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/teams/3"},
    "attributes"=>{"name"=>"Company 3", "slug"=>"testacme3"}}],
 "links"=>
  {"first"=>
    "https://api.scalus.com/api/external/v1/teams?page%5Bnumber%5D=1&page%5Bsize%5D=20",
   "last"=>
    "https://api.scalus.com/api/external/v1/teams?page%5Bnumber%5D=1&page%5Bsize%5D=20"
   }
}

GET Team

GET https://api.scalus.com/api/external/teams/:id

Returns a specific team related to the firm of the logged in user.

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/teams/4
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/teams/4', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"teams",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/teams/4"},
   "attributes"=>{
     "name"=>"Company 4",
     "slug"=>"testacme4",
     "status"=>"active"}
  }
}

POST Team

POST https://api.scalus.com/api/external/teams

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/teams', {
  access_token: 'YOUR_ACCESS_TOKEN',
  "team": {
    "name": "Team One",
    "slug": "team-one" # can not contain spaces
  }
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"teams",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/teams/4"},
   "attributes"=>{"name"=>"Team One", "slug"=>"team-one", "status"=>"active"}}}

PUT Team

PUT https://api.scalus.com/api/external/teams/:id

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.put 'https://api.scalus.com/api/external/teams/4', {
  access_token: 'YOUR_ACCESS_TOKEN',
  "team": {
    "name": "Team 1"
  }
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"teams",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/teams/4"},
   "attributes"=>{"name"=>"Team 1", "slug"=>"team-one", "status"=>"active"}}}

DELETE Team

DELETE https://api.scalus.com/api/external/teams/:id

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.delete 'https://api.scalus.com/api/external/teams/4', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"teams",
   "links"=>{"self"=>"/api/external/v1/teams/4"},
   "attributes"=>
    {"name"=>"Company 5",
     "slug"=>"testacme5",
     "status"=>"inactive"}}}

ARCHIVE Team

DELETE https://api.scalus.com/api/external/teams/:id/archive

Your Team must be inactive before you can archive it.

Once a team is archived their tasks and support email no long will function.
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.delete 'https://api.scalus.com/api/external/teams/4/archive', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"teams",
   "links"=>{"self"=>"/api/external/v1/teams/4"},
   "attributes"=>
    {"name"=>"Company 5",
     "slug"=>"testacme5",
     "status"=>"archived"}}}

Notifications

Notifications the user is involved with.

paginated with the offset not the page number

*NOTE* this endpoint is a subset of the user's activity items
Parameter Description
event_type brief word that describes what triggered the change
event_source where the event was triggered (api, auto, email, webform)
from original value
to new value
secondary_attribute ...
target_title this is the source's title if the source that changed has a title
attribute_name attribute that changed

GET Notifications

GET https://api.scalus.com/api/external/notifications

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/notifications', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  [{"id"=>"1",
    "type"=>"notifications",
    "links"=>{"self"=>"https://api.scalus.com/api/external/v1/notifications/1"},
    "attributes"=>
     {"event_type"=>"task_created",
      "event_source"=>"webform",
      "from"=>nil,
      "to"=>nil,
      "created_at"=>"2016-01-19T17:23:01-08:00",
      "secondary_attribute"=>nil,
      "target_title"=>nil,
      "attribute_name"=>nil},
    "relationships"=>
     {"activity_itemable"=>
       {"links"=>
         {"self"=>
           "https://api.scalus.com/api/external/v1/notifications/1/relationships/activity_itemable",
          "related"=>
           "https://api.scalus.com/api/external/v1/notifications/1/activity_itemable"}}}}],
 "links"=>
  {"first"=>
    "https://api.scalus.com/api/external/v1/notifications?page%5Blimit%5D=20&page%5Boffset%5D=0",
   "last"=>
    "https://api.scalus.com/api/external/v1/notifications?page%5Blimit%5D=20&page%5Boffset%5D=0"}}

GET Notification

GET https://api.scalus.com/api/external/activity_items/:id

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/notifications/4', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"notifications",
   "links"=>{"self"=>"https://api.scalus.com/api/external/v1/notifications/4"},
   "attributes"=>
    {"event_type"=>"task_created",
     "event_source"=>"webform",
     "from"=>nil,
     "to"=>nil,
     "created_at"=>"2016-01-19T17:18:01-08:00",
     "secondary_attribute"=>nil,
     "target_title"=>nil,
     "attribute_name"=>nil},
   "relationships"=>
    {"activity_itemable"=>
      {"links"=>
        {"self"=>
          "https://api.scalus.com/api/external/v1/notifications/4/relationships/activity_itemable",
         "related"=>
          "https://api.scalus.com/api/external/v1/notifications/4/activity_itemable"}}}}}

Saved Searches

To use saved searches you need to:

Parameter Description
title Names of the searches that the user that is logged in saved
params parameters that were saved (This is for reference and is not required)

GET Saved Searches

GET https://api.scalus.com/api/external/saved_searches

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/saved_searches', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  [{"id"=>"7",
    "type"=>"saved_searches",
    "links"=>
     {"self"=>"https://api.scalus.com/api/external/v1/saved_searches/7"},
    "attributes"=>
     {"title"=>"Get In progress", "params"=>{"status"=>["in_progress"]}}},
   {"id"=>"9",
    "type"=>"saved_searches",
    "links"=>
     {"self"=>"https://api.scalus.com/api/external/v1/saved_searches/9"},
    "attributes"=>
     {"title"=>"My completed", "params"=>{"status"=>["completed", "assignee_id"=>2 ]}}}],
 "links"=>
  {"first"=>
    "https://api.scalus.com/api/external/v1/saved_searches?page%5Bnumber%5D=1&page%5Bsize%5D=20",
   "last"=>
    "https://api.scalus.com/api/external/v1/saved_searches?page%5Bnumber%5D=1&page%5Bsize%5D=20"}}

GET Saved Search

GET https://api.scalus.com/api/external/saved_searches/:id

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/saved_searches/4', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"4",
   "type"=>"saved_searches",
   "links"=>
    {"self"=>"https://api.scalus.com/api/external/v1/saved_searches/4"},
   "attributes"=>
    {"title"=>"John's Completed",
     "params"=>{"status"=>["completed", "assignee_id"=>34]}}}}

Saved Search Tasks

To use saved searches you need to:

  • Create a saved search in the web application
  • GET the saved search IDS for the logged in user
  • Use the saved search ID and ping the saved_search_tasks API endpoint (this endpoint)

GET Saved Search Tasks

GET https://api.scalus.com/api/external/saved_search_tasks/:id

ID is the ID of the saved search.

This endpoint returns the tasks related to the saved search parameters.

require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/saved_search_tasks/12', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like the api/external/tasks endpoint

Users

Parameter Description
first_name First Name of the user
last_name Last Name of the user
email email of the user also used for logging in
status status of the user, Can be active or inactive
organization_id ID of the user’s organization
team Team the user in associated to
kind kind of user, Can be "Team" or "Organization"
send_task_notifications Set to true if the user receives emails when events occur around tasks
has_daily_digest Set to true if the user receives a daily email digest
created_at time user was created in their organization’s time zone

GET Users

GET https://api.scalus.com/api/external/users

GET User

GET https://api.scalus.com/api/external/users/:id

curl
-F access_token="YOUR_ACCESS_TOKEN"
-X GET https://api.scalus.com/api/external/users/32
-H "Accept: application/vnd.api+json; version=1"
-H "Content-Type: application/vnd.api+json"
require 'rest-client'
require 'json'

client_id     = '4ea1b...'
client_secret = 'a2982...'

response = RestClient.get 'https://api.scalus.com/api/external/users/32', {
  access_token: 'YOUR_ACCESS_TOKEN'
}

The above command returns JSON structured like this:

{"data"=>
  {"id"=>"32",
   "type"=>"users",
   "links"=>{"self"=>"https://api.scalus.com/api/external/users/32"},
   "attributes"=>
    {"first_name"=>"John",
     "last_name"=>"Goldstein",
     "email"=>"[email protected]",
     "kind"=>"firm",
     "status"=>"active"}}}

PUT User

PUT https://api.scalus.com/api/users/:id

DELETE User

DELETE https://api.scalus.com/api/users/:id

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.