Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Kanbanflow Webhooks #67

Open
Vygur opened this issue Nov 9, 2017 · 0 comments
Open

Support for Kanbanflow Webhooks #67

Vygur opened this issue Nov 9, 2017 · 0 comments
Labels
help wanted New Provider Issue requests a new provider be added.

Comments

@Vygur
Copy link

Vygur commented Nov 9, 2017

Support for Kanbanflow Webhooks

Documentation unfortunately is only available if you create a trial account.
Here are screens.

image

image

image
`

Property Type Comment
name String Optional.
callbackUrl String Required. Must return status code 200 on a HTTP HEAD request. Only supports http(s):// protocols.
events Array Required. Valid event names: taskCreated, taskChanged, taskDeleted, taskCommentCreated, taskCommentChanged, taskCommentDeleted. At least one must be given.Example: [{ "name": "taskCreated" }, { "name": "taskChanged" }, { "name": "taskCommentCreated" }]
filter Object Optional. Filter on a specific column, swimlane and/or changes to certain properties.Examples: { "columnId": "ff31c6b2374911e49d115f7064763810" }, { "swimlaneId": "e037a6400e8911e5bdc9053860f3e5c0" }, { "changedProperties": ["color", "totalSecondsSpent"] }

`

`

Property Type Comment
name String  
callbackUrl String Must return status code 200 on a HTTP HEAD request. Only supports http(s):// protocols.
events Array Valid event names: taskCreated, taskChanged, taskDeleted, taskCommentCreated, taskCommentChanged, taskCommentDeleted. At least one must be given.Example: [{ "name": "taskCreated" }, { "name": "taskChanged" }, { "name": "taskCommentCreated" }]
filter Object Filter on a specific column, swimlane and/or changes to certain properties.Examples: { "columnId": "ff31c6b2374911e49d115f7064763810" }, { "swimlaneId": "e037a6400e8911e5bdc9053860f3e5c0" }, { "changedProperties": ["color", "totalSecondsSpent"] }

`

`Delete webhook
Description

Delete an existing webhook.
Request format

curl -X POST https://kanbanflow.com/api/v1/webhooks/<WEBHOOK_ID>

Example request

curl -X POST https://kanbanflow.com/api/v1/webhooks/ca9126bbd12e2ebe57048f841401b14b`
`Events

Each event will deliver specific details relevant to the event type.
Task created example

{
"eventType": "taskCreated",
"userId": "ec1b92fb1868c44aa9a041583c000e2a",
"userFullName": "John Doe",
"timestamp": "2015-10-20T14:45:06.331Z",
"task": {
"_id": "60e8b629fc8d6d28b513807d7d86b133",
"name": "Write report",
"description": "For school",
"color": "green",
"columnId": "ff31c6b2374911e49d115f7064763810",
"totalSecondsSpent": 0,
"totalSecondsEstimate": 0,
"swimlaneId": "e037a6400e8911e5bdc9053860f3e5c0",
"dates": [
{
"targetColumnId": "ff31c6b4374911e49d115f7064763810",
"status": "active",
"dateType": "dueDate",
"dueTimestamp": "2015-10-20T15:00:00Z",
"dueTimestampLocal": "2015-10-20T17:00:00+02:00"
}
],
"subTasks": [
{
"name": "Proofread",
"finished": false
}
],
"labels": [
{
"name": "Writing",
"pinned": false
}
]
}
}

Task changed example

{
"eventType": "taskChanged",
"userId": "ec1b92fb1868c44aa9a041583c000e2a",
"userFullName": "John Doe",
"timestamp": "2015-10-20T14:45:13.775Z",
"task": {
"_id": "60e8b629fc8d6d28b513807d7d86b133",
"name": "Write report",
"description": "For school",
"color": "blue",
"columnId": "ff31c6b2374911e49d115f7064763810",
"totalSecondsSpent": 0,
"totalSecondsEstimate": 0,
"swimlaneId": "e037a6400e8911e5bdc9053860f3e5c0",
"dates": [
{
"targetColumnId": "ff31c6b4374911e49d115f7064763810",
"status": "active",
"dateType": "dueDate",
"dueTimestamp": "2015-10-20T15:00:00Z",
"dueTimestampLocal": "2015-10-20T17:00:00+02:00"
}
],
"subTasks": [
{
"name": "Proofread",
"finished": false
}
],
"labels": [
{
"name": "Writing",
"pinned": false
}
]
},
"changedProperties": [
{
"property": "color",
"oldValue": "red",
"newValue": "blue"
}
]
}

Task deleted example

{
"eventType": "taskDeleted",
"userId": "ec1b92fb1868c44aa9a041583c000e2a",
"userFullName": "John Doe",
"timestamp": "2015-10-20T14:45:26.138Z",
"taskId": "60e8b629fc8d6d28b513807d7d86b133",
"taskName": "Write report"
}

Comment created example

{
"eventType": "taskCommentCreated",
"userId": "ec1b92fb1868c44aa9a041583c000e2a",
"userFullName": "John Doe",
"timestamp": "2015-10-20T14:45:26.138Z",
"taskId": "60e8b629fc8d6d28b513807d7d86b133",
"taskName": "Write report",
"taskComment": {
"_id": "6620beec99fb037e13cf21cf03019914",
"text": "Finished writing report.",
"authorUserId": "ec1b92fb1868c44aa9a041583c000e2a",
"createdTimestamp": "2015-10-20T14:45:26"
}
}

Comment changed example

{
"eventType": "taskCommentChanged",
"userId": "ec1b92fb1868c44aa9a041583c000e2a",
"userFullName": "John Doe",
"timestamp": "2015-10-21T14:45:26.138Z",
"taskId": "60e8b629fc8d6d28b513807d7d86b133",
"taskName": "Write report",
"taskComment": {
"_id": "6620beec99fb037e13cf21cf03019914",
"text": "Finished writing report.",
"authorUserId": "ec1b92fb1868c44aa9a041583c000e2a",
"createdTimestamp": "2015-10-20T14:45:26",
"updatedTimestamp": "2015-10-21T14:45:26"
},
"oldTaskCommentText": "Finished writing report.",
"newTaskCommentText": "Almost finished writing report."
}

Comment deleted example

{
"eventType": "taskCommentDeleted",
"userId": "ec1b92fb1868c44aa9a041583c000e2a",
"userFullName": "John Doe",
"timestamp": "2015-10-20T14:45:26.138Z",
"taskId": "60e8b629fc8d6d28b513807d7d86b133",
"taskName": "Write report",
"taskCommentId": "6620beec99fb037e13cf21cf03019914",
"taskCommentText": "Finished writing report."
}`

`Signature verification

Each webhook has an associated secret you can use to verify that the request came from KanbanFlow. The request made to your URL endpoint will contain a special header called X-KanbanFlow-Signature. The signature is a HMAC-SHA256 hex digest of the payload using the secret as the key. Exactly how to verify the signature depends on your platform. Using Node.js for example, the signature can be verified as follows:

var crypto = require('crypto');

function verifyKanbanFlowWebhookRequest(request, secret) {
var content = request.body;
var digest = crypto.createHmac('sha256', secret).update(content).digest('hex');
var signature = request.headers['x-kanbanflow-signature'];
return digest === signature;
}`

@dscalzi dscalzi added New Provider Issue requests a new provider be added. and removed enhancement labels Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted New Provider Issue requests a new provider be added.
Projects
None yet
Development

No branches or pull requests

3 participants