Index
Setup client:
require 'vendor/autoload.php';
use Onetoweb\Monday\Client as MondayClient;
// param
$apiKey = 'api_key';
// setup client
$client = new MondayClient($apiKey);
You can use one of the built in endpoints see examples below:
- Accounts
- Activity logs
- App subscriptions
- Boards
- Board views
- Columns
- Column values
- Complexity
- Documents
- Document blocks
- Files
- Groups
- Items
- Me
- Notifications
- Plan
- Subitems
- Tags
- Teams
- Updates
- Users
- Webhooks
- Workspaces
You can fetch data by building a query payload:
use Onetoweb\Monday\Payload\Payload;
// example selecting boards, items, subitems and updates
$payload = new Payload('query', [], [
new Payload('boards', ['limit' => 5, 'page' => 0], ['id', 'name',
new Payload('items_page', ['limit' => 3], [
'cursor', // contains cursor token to load the next item page
new Payload('items', [], ['id', 'name',
new Payload('subitems', [], ['id', 'name',
new Payload('updates', [], ['body'])
])
])
])
])
]);
$result = $client->request($payload);
You can manipulate data by building a mutation payload:
use Onetoweb\Monday\Payload\Payload;
// create board
$payload = new Payload('mutation', [], [
new Payload('create_board', [
'board_name' => 'new board created via api',
'board_kind' => 'public',
'description' => 'board description'
], ['id'])
]);
$result = $client->request($payload);