Skip to content

Members TypeScript

BL edited this page Jun 8, 2018 · 2 revisions

Usage

export TRELLO_API_KEY=KEY
export TRELLO_OAUTH_TOKEN=TOKEN

Configuration

Set your Trello Api Key and Trello Auth Token.

import * as TrelloNodeAPI from 'trello-node-api';
const Trello = new TrelloNodeAPI();
Trello.setApiKey(apiKey);
Trello.setOauthToken(oauthToken);

Members

Search Member

    let response;
    try {
        response = await Trello.member.search('MEMBER_ID');
    } catch (error) {
        if (error) {
            console.log('error ', error);
        }
    }
    console.log('response', response);

Search Field Member

    try {
        response = await Trello.member.searchField('MEMBER_ID', 'FIELD_NAME');
    } catch (error) {
        if (error) {
            console.log('error ', error);
        }
    }
    console.log('response', response);

Search Member Board

    let response;
    try {
        response = await Trello.member.searchBoards('MEMBER_ID');
    } catch (error) {
        if (error) {
            console.log('error ', error);
        }
    }
    console.log('response', response);