Java wrapper around Trello API
Java
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 23 commits ahead, 2 commits behind johanmynhardt:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.editorconfig
.gitignore
.travis.yml
LICENSE.txt
README.markdown
pom.xml

README.markdown

Build Status

Introduction

trello4j is a java wrapper around Trello API.

You need to get a API key and optionally generate a token here to be able to use Trello's API.

Please report any issues and/or participate in the development here :)

Getting started

Get trello4j from unofficial maven repo

<repository>
    <id>bintray-fornever-maven</id>
    <name>bintray</name>
    <url>http://dl.bintray.com/fornever/maven</url>
</repository>

...

<dependency>
    <groupId>me.fornever</groupId>
	<artifactId>trello4j</artifactId>
	<version>1.0.0</version>
</dependency>	

Get source and build it

git clone https://github.com/ForNeVeR/trello4j.git
cd trello4j
mvn install

Now you got two options:

  1. Use trello4j from your local maven repo, add dependency groupId: me.fornever / artifactId: trello4j
  2. Use jar that was built in directory target/

Usage

// myToken is optional, set to null if you are accessing public data
Trello trello = new TrelloImpl("myApiKey", "myToken");  

// example: get organization by its name
Organization org = trello.getOrganization("fogcreek");
MethodVersion
Actions
GET /1/actions/[action_id] IMPLEMENTED
GET /1/actions/[action_id]/[field] TODO
GET /1/actions/[action_id]/board IMPLEMENTED
GET /1/actions/[action_id]/board/[field] TODO
GET /1/actions/[action_id]/card IMPLEMENTED
GET /1/actions/[action_id]/card/[field] TODO
GET /1/actions/[action_id]/list IMPLEMENTED
GET /1/actions/[action_id]/list/[field] TODO
GET /1/actions/[action_id]/member IMPLEMENTED
GET /1/actions/[action_id]/member/[field] TODO
GET /1/actions/[action_id]/memberCreator IMPLEMENTED
GET /1/actions/[action_id]/memberCreator/[field] TODO
GET /1/actions/[action_id]/organization IMPLEMENTED
GET /1/actions/[action_id]/organization/[field] TODO
Boards
GET /1/boards/[board_id] IMPLEMENTED
GET /1/boards/[board_id]/[field] TODO
GET /1/boards/[board_id]/actions IMPLEMENTED
GET /1/boards/[board_id]/cards IMPLEMENTED
GET /1/boards/[board_id]/cards/[filter] IMPLEMENTED
GET /1/boards/[board_id]/cards/[idCard] IMPLEMENTED
GET /1/boards/[board_id]/checklists IMPLEMENTED
GET /1/boards/[board_id]/lists IMPLEMENTED
GET /1/boards/[board_id]/lists/[filter] IMPLEMENTED
GET /1/boards/[board_id]/members IMPLEMENTED
GET /1/boards/[board_id]/members/[filter] IMPLEMENTED
GET /1/boards/[board_id]/membersInvited IMPLEMENTED
GET /1/boards/[board_id]/membersInvited/[field]IMPLEMENTED
GET /1/boards/[board_id]/myPrefs IMPLEMENTED
GET /1/boards/[board_id]/organization IMPLEMENTED
GET /1/boards/[board_id]/organization/[field] IMPLEMENTED
PUT /1/boards/[board_id] TODO
PUT /1/boards/[board_id]/closed IMPLEMENTED
PUT /1/boards/[board_id]/desc TODO
PUT /1/boards/[board_id]/name TODO
POST /1/boards TODO
POST /1/boards/[board_id]/checklists TODO
POST /1/boards/[board_id]/lists TODO
POST /1/boards/[board_id]/myPrefs TODO
Cards
GET /1/cards/[card_id] IMPLEMENTED
GET /1/cards/[card_id]/[field] TODO
GET /1/cards/[card_id]/actions IMPLEMENTED
GET /1/cards/[card_id]/attachments IMPLEMENTED
GET /1/cards/[card_id]/board IMPLEMENTED
GET /1/cards/[card_id]/board/[field] IMPLEMENTED
GET /1/cards/[card_id]/checkItemStates IMPLEMENTED
GET /1/cards/[card_id]/checklists IMPLEMENTED
GET /1/cards/[card_id]/list IMPLEMENTED
GET /1/cards/[card_id]/list/[field] TODO
GET /1/cards/[card_id]/members IMPLEMENTED
PUT /1/cards/[card_id] TODO
PUT /1/cards/[card_id]/closed TODO
PUT /1/cards/[card_id]/desc TODO
PUT /1/cards/[card_id]/due TODO
PUT /1/cards/[card_id]/idList TODO
PUT /1/cards/[card_id]/name TODO
POST /1/cards IMPLEMENTED
POST /1/cards/[card_id]/actions/comments IMPLEMENTED
POST /1/cards/[card_id]/attachments IMPLEMENTED
POST /1/cards/[card_id]/checklists IMPLEMENTED
POST /1/cards/[card_id]/labels IMPLEMENTED
POST /1/cards/[card_id]/members IMPLEMENTED
POST /1/cards/[card_id]/membersVoted IMPLEMENTED
DELETE /1/cards/[card_id] IMPLEMENTED
DELETE /1/cards/[card_id]/checklists/[idChecklist] IMPLEMENTED
DELETE /1/cards/[card_id]/labels/[color] IMPLEMENTED
DELETE /1/cards/[card_id]/members/[idMember] IMPLEMENTED
DELETE /1/cards/[card_id]/membersVoted/[idMember] IMPLEMENTED
Checklists
GET /1/checklists/[checklist_id] IMPLEMENTED
GET /1/checklists/[checklist_id]/[field] TODO
GET /1/checklists/[checklist_id]/board IMPLEMENTED
GET /1/checklists/[checklist_id]/board/[field] TODO
GET /1/checklists/[checklist_id]/cards IMPLEMENTED
GET /1/checklists/[checklist_id]/cards/[filter] IMPLEMENTED
GET /1/checklists/[checklist_id]/checkItems IMPLEMENTED
PUT /1/checklists/[checklist_id] TODO
PUT /1/checklists/[checklist_id]/name TODO
POST /1/checklists TODO
POST /1/checklists/[checklist_id]/checkItems TODO
DELETE /1/checklists/[checklist_id]/checkItems/[idCheckItem] TODO
Lists
GET /1/lists/[list_id] IMPLEMENTED
GET /1/lists/[list_id]/[field] TODO
GET /1/lists/[list_id]/actions IMPLEMENTED
GET /1/lists/[list_id]/board IMPLEMENTED
GET /1/lists/[list_id]/board/[field] TODO
GET /1/lists/[list_id]/cards IMPLEMENTED
GET /1/lists/[list_id]/cards/[filter] IMPLEMENTED
PUT /1/lists/[list_id] TODO
PUT /1/lists/[list_id]/closed TODO
PUT /1/lists/[list_id]/name TODO
POST /1/lists TODO
POST /1/lists/[list_id]/cards TODO
Members
GET /1/members/[member_id or username] IMPLEMENTED
GET /1/members/[member_id or username]/[field] TODO
GET /1/members/[member_id or username]/actions IMPLEMENTED
GET /1/members/[member_id or username]/boards IMPLEMENTED
GET /1/members/[member_id or username]/boards/[filter] IMPLEMENTED
GET /1/members/[member_id or username]/boardsInvited IMPLEMENTED
GET /1/members/[member_id or username]/boardsInvited/[field] TODO
GET /1/members/[member_id or username]/cards IMPLEMENTED
GET /1/members/[member_id or username]/cards/[filter] IMPLEMENTED
GET /1/members/[member_id or username]/notifications IMPLEMENTED
GET /1/members/[member_id or username]/notifications/[filter] IMPLEMENTED
GET /1/members/[member_id or username]/organizations IMPLEMENTED
GET /1/members/[member_id or username]/organizations/[filter] IMPLEMENTED
GET /1/members/[member_id or username]/organizationsInvited IMPLEMENTED
GET /1/members/[member_id or username]/organizationsInvited/[field] TODO
PUT /1/members/[member_id or username] TODO
PUT /1/members/[member_id or username]/bio TODO
PUT /1/members/[member_id or username]/fullName TODO
PUT /1/members/[member_id or username]/initials TODO
Notifications
GET /1/notifications/[notification_id] IMPLEMENTED
GET /1/notifications/[notification_id]/[field] TODO
GET /1/notifications/[notification_id]/board IMPLEMENTED
GET /1/notifications/[notification_id]/board/[field] TODO
GET /1/notifications/[notification_id]/card IMPLEMENTED
GET /1/notifications/[notification_id]/card/[field] TODO
GET /1/notifications/[notification_id]/list IMPLEMENTED
GET /1/notifications/[notification_id]/list/[field] TODO
GET /1/notifications/[notification_id]/member IMPLEMENTED
GET /1/notifications/[notification_id]/member/[field] TODO
GET /1/notifications/[notification_id]/memberCreator IMPLEMENTED
GET /1/notifications/[notification_id]/memberCreator/[field] TODO
GET /1/notifications/[notification_id]/organization IMPLEMENTED
GET /1/notifications/[notification_id]/organization/[field] TODO
Organizations
GET /1/organizations/[org_id or name] IMPLEMENTED
GET /1/organizations/[org_id or name]/[field] TODO
GET /1/organizations/[org_id or name]/actions IMPLEMENTED
GET /1/organizations/[org_id or name]/boards IMPLEMENTED
GET /1/organizations/[org_id or name]/boards/[filter] IMPLEMENTED
GET /1/organizations/[org_id or name]/members IMPLEMENTED
GET /1/organizations/[org_id or name]/members/[filter] IMPLEMENTED
PUT /1/organizations/[org_id or name] TODO
PUT /1/organizations/[org_id or name]/desc TODO
PUT /1/organizations/[org_id or name]/displayName TODO
PUT /1/organizations/[org_id or name]/name TODO
PUT /1/organizations/[org_id or name]/website TODO
POST /1/organizations TODO
DELETE /1/organizations/[org_id or name] TODO
Tokens
GET /1/tokens/[token] IMPLEMENTED
GET /1/tokens/[token]/[field] TODO
GET /1/tokens/[token]/member IMPLEMENTED
GET /1/tokens/[token]/member/[field] TODO
Types
GET /1/types/[id] IMPLEMENTED

Contributors

Test environment

To execute the tests, you should register on Trello if you still haven't done so. After that get the API key using link https://trello.com/1/appKey/generate. Copy only the key field from that page - that's your API key. After that you should get access token for running the tests. Prepare and visit the link https://trello.com/1/authorize?key={your_API_key}&name=trello4j&expiration=never&response_type=token&scope=read,write.

Now you want to know identifier of your test board. Visit the page https://api.trello.com/1/members/{your_user_name}/boards?key={your_API_key}&token={tour_API_token} and get the identifier from there.

Some tests also will use the list and you need to create it manually (because lists cannot be permanently deleted and we don't want our tests to litter your Trello account). To get list identifier, visit https://api.trello.com/1/boards/{your_board_id}/lists?key={your_API_key}&token={tour_API_token}.

Set the environment variables TRELLO_API_KEY, TRELLO_API_TOKEN, TRELLO_BOARD_ID and TRELLO_LIST_ID to that values and also TRELLO_USER_NAME to your user name and you're ready to execute mvn test.

Release management

If you want to publish the artifact to your bintray account as discussed here, do the following:

  1. Make sure you've set all the settings to ~/.m2/settings.xml.
  2. Change pom.xml accordingly.
  3. Generate artifacts with $mvn -Prelease clean package -DskipTests=true.
  4. Copy pom.xml with the name of trello4j-<version>.pom and upload it to repository.
  5. Upload binary artifacts to bintray or to another repository.