|
1 | | -# Symfony Monday Api |
| 1 | +# Symfony Monday API |
2 | 2 |
|
3 | | -This is a Symfony 6/7 Bundle helps you to use monday API v2 : https://developer.monday.com/apps/docs/mondayapi. |
4 | | -It use version 2023-10. |
| 3 | +This is a Symfony 6/7 Bundle that helps you use the Monday.com API v2: |
| 4 | +https://developer.monday.com/apps/docs/mondayapi |
| 5 | +It uses version `2023-10` of the API. |
5 | 6 |
|
6 | 7 | ## Installation |
7 | 8 |
|
8 | | -**1** Add to composer.json to the `require` key |
| 9 | +Install the package via Composer: |
9 | 10 |
|
10 | | -``` shell |
11 | | - composer require gponty/symfony-monday-api-bundle |
| 11 | +```bash |
| 12 | +composer require gponty/symfony-monday-api-bundle |
12 | 13 | ``` |
13 | 14 |
|
14 | | -**2** Add to local .env file |
15 | | - |
16 | | -``` shell |
17 | | - MONDAY_API_KEY=your_token |
18 | | - |
19 | | -``` |
| 15 | +## Usage |
20 | 16 |
|
21 | | -**3** Add to framework config file config/packages/framework.yml |
| 17 | +Inject the service into your controller: |
22 | 18 |
|
23 | | -``` shell |
24 | | -monday: |
25 | | - api_key: '%env(MONDAY_API_KEY)%' |
| 19 | +```php |
| 20 | +public function __construct( |
| 21 | + readonly MondayApiService $mondayApiService |
| 22 | +) {} |
26 | 23 | ``` |
27 | 24 |
|
| 25 | +Use the service like this: |
| 26 | + |
| 27 | +```php |
| 28 | +$query = '{ |
| 29 | + boards(ids: 123456789) { |
| 30 | + id |
| 31 | + name |
| 32 | + groups { |
| 33 | + id |
| 34 | + title |
| 35 | + items_page(limit: 100, page: 1) { |
| 36 | + cursor |
| 37 | + items { |
| 38 | + id |
| 39 | + name |
| 40 | + } |
| 41 | + } |
| 42 | + } |
| 43 | + } |
| 44 | +}'; |
28 | 45 |
|
29 | | -## Usage |
| 46 | +$this->mondayApiService->setApiKey('your-api-key-here'); |
| 47 | +$response = $this->mondayApiService->request($query); |
| 48 | +``` |
30 | 49 |
|
31 | | -Inject the service in your controller : |
| 50 | +## Changelog |
32 | 51 |
|
33 | | -``` php |
34 | | - public function __construct(readonly MondayApiService $mondayApiService) |
35 | | - { } |
36 | | -``` |
| 52 | +### Version 1.0.7 |
37 | 53 |
|
38 | | -Use the service : |
39 | | - |
40 | | -``` php |
41 | | - $query = '{ |
42 | | - boards(ids: 123456789) { |
43 | | - id |
44 | | - name |
45 | | - groups { |
46 | | - id |
47 | | - title |
48 | | - items_page(limit: 100, page:1) { |
49 | | - cursor |
50 | | - items{ |
51 | | - id |
52 | | - name |
53 | | - } |
54 | | - } |
55 | | - } |
56 | | - }'; |
57 | | - $response = $this->mondayApiService->request($query); |
58 | | -``` |
| 54 | +You must now call `setApiKey()` before using the `request()` method. |
| 55 | +You MUST also remove the `config/packages/monday.yaml` file if it exists. |
59 | 56 |
|
60 | 57 | ## License |
61 | 58 |
|
62 | | -This bundle is under the MIT license. See the complete license in the bundle. |
| 59 | +This bundle is released under the MIT License. See the LICENSE file for more information. |
0 commit comments