Skip to content

Actions JavaScript

BL edited this page Dec 9, 2017 · 1 revision

Usage

export TRELLO_API_KEY=KEY
export TRELLO_OAUTH_TOKEN=TOKEN

Configuration

Set your Trello Api Key and Trello Auth Token.

var Trello = require('trello-node-api')(TRELLO_API_KEY, TRELLO_OAUTH_TOKEN);

Actions

Search Action

    Trello.action.search('ACTION_ID').then(function (response) {
        console.log('response ', response);
    }).catch(function (error) {
        console.log('error', error);
    });

Search Field Action

   Trello.action.searchField('ACTION_ID', 'FIELD_NAME').then(function (response) {
           console.log('response ', response);
   }).catch(function (error) {
           console.log('error', error);
   });

Update Action

   var id = 'ACTION_ID';  // REQUIRED
   var data = {
       text: 'text' // REQUIRED
   };
   Trello.action.update(id, data).then(function (response) {
       console.log('response ', response);
   }).catch(function (error) {
       console.log('error', error);
   });

Delete Action

   Trello.action.del('ACTION_ID').then(function (response) {
       console.log('response ', response);
   }).catch(function (error) {
       console.log('error', error);
   });