Integrating using the Teamline API

Note: This documentation is written for developers who would like to build an automated interface to Teamline. For an easier way to integrate Teamline with other applications, try using the  Teamline Zapier integration.

You can use the API to do things like:

  • Creating new tasks
  • Marking existing tasks complete
  • Viewing a list of tasks
  • Getting automatically notified when tasks are completed

You can generate an API key at https://my.teamline.app/settings/api. All API requests inherit the permissions of the user who created the API key.

API base url

The url prefix for each endpoint is  https://integration.teamline.app/api/

Errors

When an error occurs you'll receive a response telling you what happened and how to fix it. This response will contain a machine readable  error field, at times there may also be an errorText field if we feel like it needs some more explaining.

{
  "errorText": "Something went super duper badly",
  "error": "super_duper_bad"
  "ok: false"
}
	

API endpoints

auth.test

input:

  • token: String, required

output:

{
  "data": {
    "user": {
      "id": "U0L8G1LTB",
      "name": "batman",
      "email": "alfred@batman.com"
    }
  },
  "ok": true
}
	

tasks.complete

input:

  • token: String, required
  • task: String, required | id of task to complete

output:

{
  "data": {
    "tasks": {
      "id": "ih9KKwhfbEudPPSco",
      "team": {
        "id": "T0L8CR3RB",
        "name": "batman",
        "domain": "batman"
      },
      "name": "NaNaNaNa",
      "commentCount": 0,
      "fileCount": 0,
      "checklistTotal": 0,
      "checklistComplete": 0,
      "isComplete": true,
      "isPersonal": false,
      "completed": "2017-03-20T12:05:52.812Z",
      "created": "2017-03-17T13:30:56.914Z",
      "updated": "2017-03-17T17:24:15.719Z",
      "channel": {
        "id": "G0UE3BGAK",
        "name": "NaNaNaNa"
      },
      "list": {
        "id": "wcrsPuHitrgiNGAXt",
        "name": "Bam!"
      },
      "creator": {
        "id": "U0L8G1LTB",
        "name": "alfred",
        "email": "alfred@batman.com"
      },
      "assigned": [
        {
          "id": "U0L8G1LTB",
          "name": "alfred",
          "email": "alfred@batman.com"
        }
      ],
      "due": {
        "timestamp": "2017-03-21T01:00:00.000Z",
        "date": "2017-03-21",
        "tz": "America/Gotham",
        "time": "09:00"
      },
      "labels": [
        {
          "id": 0,
          "color": "red",
          "name": "important"
        }
      ]
    }
  },
  "ok": true
}
	

tasks.create

input:

  • token: String, required
  • name: String, required | name of the task
  • description: String
  • assign: [String] |  @name, email address or slackId format
  • channel: String | #channel-name or slackId format
  • list: String | ~list-name or id format, channel is required if this is present
  • personal: Boolean | overrides the default privacy setting
  • due: String | ISO8601 format, we'll attempt to parse a humanized string like "next wednesday at 3:30pm" as well
  • notify: [String] | @name, email address or slackId format, assigned members won't be notified twice

output:

{
  "data": {
    "task": {
      "id": "ih9KKwhfbEudPPSco",
      "team": {
        "id": "T0L8CR3RB",
        "name": "batman",
        "domain": "batman"
      },
      "name": "NaNaNaNa",
      "commentCount": 0,
      "fileCount": 0,
      "checklistTotal": 0,
      "checklistComplete": 0,
      "isComplete": false,
      "isPersonal": false,
      "created": "2017-03-17T13:30:56.914Z",
      "updated": "2017-03-17T17:24:15.719Z",
      "channel": {
        "id": "G0UE3BGAK",
        "name": "NaNaNaNa"
      },
      "list": {
        "id": "wcrsPuHitrgiNGAXt",
        "name": "Bam!"
      },
      "creator": {
        "id": "U0L8G1LTB",
        "name": "alfred",
        "email": "alfred@batman.com"
      },
      "assigned": [
        {
          "id": "U0L8G1LTB",
          "name": "alfred",
          "email": "alfred@batman.com"
        }
      ],
      "due": {
        "timestamp": "2017-03-21T01:00:00.000Z",
        "date": "2017-03-21",
        "tz": "America/Gotham",
        "time": "09:00"
      },
      "labels": [
        {
          "id": 0,
          "color": "red",
          "name": "important"
        }
      ]
    }
  },
  "ok": true
}
	

tasks.list

input:

  • token: String, required
  • limit: Integer
  • channel: String | #channel-name or slackId format
  • list: String | ~list-name or id format, channel is required if this is present
  • user: String | @name, email address or slackId format, if channel and user are omitted it defaults to yourself

output:

{
  "data": {
    "tasks": [
      {
        "id": "ih9KKwhfbEudPPSco",
        "team": {
          "id": "T0L8CR3RB",
          "name": "batman",
          "domain": "batman"
        },
        "name": "NaNaNaNa",
        "commentCount": 0,
        "fileCount": 0,
        "checklistTotal": 0,
        "checklistComplete": 0,
        "isComplete": false,
        "isPersonal": false,
        "created": "2017-03-17T13:30:56.914Z",
        "updated": "2017-03-17T17:24:15.719Z",
        "channel": {
          "id": "G0UE3BGAK",
          "name": "NaNaNaNa"
        },
        "list": {
          "id": "wcrsPuHitrgiNGAXt",
          "name": "Bam!"
        },
        "creator": {
          "id": "U0L8G1LTB",
          "name": "alfred",
          "email": "alfred@batman.com"
        },
        "assigned": [
          {
            "id": "U0L8G1LTB",
            "name": "alfred",
            "email": "alfred@batman.com"
          }
        ],
        "due": {
          "timestamp": "2017-03-21T01:00:00.000Z",
          "date": "2017-03-21",
          "tz": "America/Gotham",
          "time": "09:00"
        },
        "labels": [
          {
            "id": 0,
            "color": "red",
            "name": "important"
          }
        ]
      }
    ]
  },
  "ok": true
}
	

webhooks.create

input:

  • token: String, required
  • name: String
  • event: String, required | currently only supports tasks_completed
  • url: String, required | url of where you want the webhook to POST

output:

{
  "data": {
    "hook": {
      "id": "p2bwNn3yz3RHuEbKk"
    }
  },
  "ok": true
}
	

webhooks.remove

input:

  • token: String, required
  • hook: String, required | id of hook to remove

output:

{
  "data": {
    "hook": {
      "id": "nfstBhtYvSYKt7Pq5",
      "event": "tasks_completed",
      "url": "https://batman.com/notify",
      "name": "Tasks Completed"
    }
  },
  "ok": true
}
	

webhook events

tasks_completed

{
  "triggered": "2017-03-29T12:38:10.385Z",
  "event": "tasks_completed",
  "data": {
    "task": {
      "id": "ih9KKwhfbEudPPSco",
      "team": {
        "id": "T0L8CR3RB",
        "name": "batman",
        "domain": "batman"
      },
      "name": "NaNaNaNa",
      "commentCount": 0,
      "fileCount": 0,
      "checklistTotal": 0,
      "checklistComplete": 0,
      "isComplete": true,
      "isPersonal": false,
      "completed": "2017-03-20T12:05:52.812Z",
      "created": "2017-03-17T13:30:56.914Z",
      "updated": "2017-03-17T17:24:15.719Z",
      "channel": {
        "id": "G0UE3BGAK",
        "name": "NaNaNaNa"
      },
      "list": {
        "id": "wcrsPuHitrgiNGAXt",
        "name": "Bam!"
      },
      "creator": {
        "id": "U0L8G1LTB",
        "name": "alfred",
        "email": "alfred@batman.com"
      },
      "assigned": [
        {
          "id": "U0L8G1LTB",
          "name": "alfred",
          "email": "alfred@batman.com"
        }
      ],
      "due": {
        "timestamp": "2017-03-21T01:00:00.000Z",
        "date": "2017-03-21",
        "tz": "America/Gotham",
        "time": "09:00"
      },
      "labels": [
        {
          "id": 0,
          "color": "red",
          "name": "important"
        }
      ]
    }
  }
}

Still need help? Contact Us Contact Us