virgiliopontes/trello-api

A simple Trello client library. Forked from https://github.com/SimplesVet/trello-api-php

1.0.0 2020-09-04 04:36 UTC

This package is auto-updated.

Last update: 2024-10-04 21:14:53 UTC


README

PHP SDK to use Trello Api

Authentication

$key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';

See how to get API Key and Token

User

$trelloBoard = new Trello\User($key, $token);
$boardId = 'xxxxxxxxxxxxxxxxxxxxxxxx';

// Getting board info
$return = $trelloBoard->get($boardId);

// Getting list of members from board
$return = $trelloBoard->get($boardId, 'members');

// Getting list of cards from board
$arguments = array(
    'fields' => 'id,name,idList'
);
$return = $trelloBoard->get($boardId, 'cards', $arguments);

Boards

$trelloBoard = new Trello\Board($key, $token);
$boardId = 'xxxxxxxxxxxxxxxxxxxxxxxx';

// Getting board info
$return = $trelloBoard->get($boardId);

// Getting list of members from board
$return = $trelloBoard->get($boardId, 'members');

// Getting list of cards from board
$arguments = array(
    'fields' => 'id,name,idList'
);
$return = $trelloBoard->get($boardId, 'cards', $arguments);

See Boards in API Reference

Cards

$trelloCard = new Trello\Card($key, $token);
$cardId = 'xxxxxxxxxxxxxxxxxxxxxxxx';

// Getting Card Info
$return = $trelloCard->get($cardId);

// Getting Card Actions
$return = $trelloCard->get($cardId, 'actions');

// Creating a Card
$data = array(
    'name' => 'Test card',
    'desc' => 'This is a test card',
    'due' => null,
    'idList' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
    'urlSource' => null
);
$return = $trelloCard->post($data);

See Cards in API Reference