- Features
- Service Configuration
- Runner Mode
- Server Mode
- Running With Docker
- Example
entrello
Services - Trello Webhooks Reference
- Synchronizes all your tasks from various sources in one Trello board.
- Lets you build automations that can be triggered when a card is archived.
- Can be used either as a server or a runner (e.g. a cronjob).
entrello
synchronizes your tasks from one or more sources in one Trello board by:
- Polling one or more of your custom HTTP services, each of which must return a JSON array of "tasks".
- Creating a new card in your Trello board for each new task it has received from your services.
- Optionally deleting any existing stale cards in your Trello board.
Synchronization feature is supported by both the runner and server modes.
entrello
lets you build custom automations based on archived card events:
- Whenever a Trello card is archived (i.e. done), it
POST
s this event to the matching HTTP service, if any. - Your service may handle this
POST
request and take further actions, e.g. it could update some value in a spreadsheet.
Automation feature is supported only by the server mode, which listens for Trello webhooks.
See config.example.json
for reference.
Your custom HTTP services must each return a JSON array of Trello card objects upon GET
requests.
-
name
— Service name. -
endpoint
— Service endpoint URL. -
label_id
— Trello label ID. A label ID can be associated with no more than one service. -
list_id
— Trello list ID, i.e. where to insert new cards. The list must be in the board specified by the root-levelboard_id
config parameter. -
period
— Polling period. A few examples:// poll on 3rd, 6th, 9th, ... of each month, at 00:00 "period": { "type": "day", "interval": 3 } // poll every day at 00:00, 02:00, 04:00, ... "period": { "type": "hour", "interval": 2 } // poll every hour at XX:00, XX:15, XX:30, XX:45 "period": { "type": "minute", "interval": 15 } // poll on each execution "period": { "type": "default" }
-
secret
— Alphanumeric API secret. If present,entrello
will put it in theX-Api-Key
HTTP header. -
strict
— Whether stale cards should be deleted from the board upon synchronization.false
by default.
Create a service configuration file based on config.example.json
. You can trigger a one-off synchronization by executing the runner:
# run this as a scheduled (cron) job
go run ./cmd/runner -c /path/to/config/file
If the -c
flag is omitted, the runner looks for a file called config.json
in the current working directory:
# these two are equivalent:
go run ./cmd/runner
go run ./cmd/runner -c ./config.json
Put your environment variables in a file called .env
based on .env.example
and start the server:
go run ./cmd/server
You can trigger a one-off synchronization by making a POST
request to the server with the service configuration in the request body:
# run this as a scheduled (cron) job
curl <SERVER_URL> \
-d @<path/to/config.json> \
-H "Authorization: Basic <base64(<USERNAME>:<PASSWORD>)>"
To enable automation for one or more services:
- Create a Trello webhook by setting the callback URL to
<ENTRELLO_SERVER_URL>/trello-webhook
- Set the
SERVICES
environment variable, a comma-separated list of service configuration strings:- A service configuration string must contain the Trello label ID and the service endpoint:
<TRELLO_LABEL_ID>@<SERVICE_ENDPOINT_URL>
- It may additionally contain an API secret – alphanumeric only – for authentication purposes:
# the HTTP header "X-Api-Key" will be set to "SuPerSecRetPassW0rd" in each request <TRELLO_LABEL_ID>:SuPerSecRetPassW0rd@<SERVICE_ENDPOINT_URL>
- A service configuration string must contain the Trello label ID and the service endpoint:
A new Docker image will be created upon each release.
-
Authenticate with the GitHub container registry (only once):
echo $GITHUB_ACCESS_TOKEN | docker login ghcr.io -u GITHUB_USERNAME --password-stdin
-
Pull the latest Docker image:
docker pull ghcr.io/utkuufuk/entrello/image:latest
-
Spawn & run a container:
# server docker run -d \ -p <PORT>:<PORT> \ --env-file </absolute/path/to/.env> \ --restart unless-stopped \ --name entrello-server \ ghcr.io/utkuufuk/entrello/image:latest # runner docker run --rm \ -v </absolute/path/to/config.json>:/bin/config.json \ ghcr.io/utkuufuk/entrello/image:latest \ ./runner
You may use these as references for developing your own services:
# create new webhook
curl -X POST -H "Content-Type: application/json" -d \
'{
"key": "<TRELLO_API_KEY>",
"callbackURL": "<ENTRELLO_SERVER_CALLBACK_URL>",
"idModel": "<TRELLO_BOARD_ID>",
"description": "<DESCRIPTION>"
}' https://api.trello.com/1/tokens/<TRELLO_API_TOKEN>/webhooks/
# list all webhooks
curl https://api.trello.com/1/members/me/tokens?webhooks=true&key=<TRELLO_API_KEY>&token=<TRELLO_API_TOKEN>
# delete existing webhook
curl -X DELETE https://api.trello.com/1/webhooks/<TRELLO_WEBHOOK_ID>?key=<TRELLO_API_KEY>&token=<TRELLO_API_TOKEN>
For more information on Trello webhooks: