gponty / symfony-monday-api-bundle
Service to use api Monday.com in Symfony
Package info
github.com/gponty/symfony-monday-api
Type:symfony-bundle
pkg:composer/gponty/symfony-monday-api-bundle
Requires
- php: >=8.2
- symfony/config: ^6.0|^7.0|^8.0
- symfony/dependency-injection: ^6.0|^7.0|^8.0
- symfony/http-kernel: ^6.0|^7.0|^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.17
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpstan/phpstan-symfony: ^1.3
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This is a Symfony 6/7/8 Bundle that helps you use the Monday.com API v2:
https://developer.monday.com/apps/docs/mondayapi
It uses version 2023-10 of the API.
Installation
Install the package via Composer:
composer require gponty/symfony-monday-api-bundle
Usage
Inject the service into your controller:
public function __construct( readonly MondayApiService $mondayApiService ) {}
Use the service like this:
$query = '{ boards(ids: 123456789) { id name groups { id title items_page(limit: 100, page: 1) { cursor items { id name } } } } }'; $this->mondayApiService->setApiKey('your-api-key-here'); try { $response = $this->mondayApiService->request($query); } catch (MondayApiException $e) { // $e->getMessage() carries the HTTP status and the reason given by Monday.com, // $e->getStatusCode(), $e->getResponseBody() and $e->getQuery() give the details }
Changelog
Version 2.0.0
request() now throws a MondayApiException when the API cannot be reached or
answers with an HTTP error status (4xx/5xx), instead of a bare PHP warning that
lost the response body. The exception message carries the HTTP status, the error
message returned by Monday.com and the beginning of the query; the raw body,
status and query are available through its getters. createGroup(),
createItem() and createSubItem() propagate it. Successful responses are
handled as before.
Version 1.0.7
You must now call setApiKey() before using the request() method.
You MUST also remove the config/packages/monday.yaml file if it exists.
License
This bundle is released under the MIT License. See the LICENSE file for more information.