You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: LICENSE
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
Copyright 2025 beeperdesktop
1
+
Copyright 2026 beeperdesktop
2
2
3
3
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
> The Beeper Desktop PHP API Library is currently in **beta** and we're excited for you to experiment with it!
5
-
>
6
-
> This library has not yet been exhaustively tested in production environments and may be missing some features you'd expect in a stable release. As we continue development, there may be breaking changes that require updates to your code.
7
-
>
8
-
> **We'd love your feedback!** Please share any suggestions, bug reports, feature requests, or general thoughts by [filing an issue](https://www.github.com/beeper/beeper-desktop-api-php/issues/new).
9
-
10
3
The Beeper Desktop PHP library provides convenient access to the Beeper Desktop REST API from any PHP 8.1.0+ application.
11
4
12
-
It is generated with [Stainless](https://www.stainless.com/).
13
-
14
5
## Documentation
15
6
16
-
The REST API documentation can be found on [www.beeper.com](https://www.beeper.com/desktop-api).
7
+
The REST API documentation can be found on [developers.beeper.com](https://developers.beeper.com/desktop-api/).
17
8
18
9
## Installation
19
10
11
+
To use this package, install via Composer by adding the following to your application's `composer.json`:
// make additional network requests to fetch items from all pages, including and after the current page
85
+
foreach ($page->pagingEachItem() as $item) {
86
+
var_dump($item->id);
87
+
}
88
+
```
89
+
53
90
### Handling errors
54
91
55
-
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `BeeperDesktop\Errors\APIError` will be thrown:
92
+
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `BeeperDesktop\Core\Exceptions\APIException` will be thrown:
56
93
57
94
```php
58
95
<?php
59
96
60
-
use BeeperDesktop\Errors\APIConnectionError;
97
+
use BeeperDesktop\Core\Exceptions\APIConnectionException;
98
+
use BeeperDesktop\Core\Exceptions\RateLimitException;
99
+
use BeeperDesktop\Core\Exceptions\APIStatusException;
Certain errors will be automatically retried 3 times by default, with a short exponential backoff.
132
+
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
94
133
95
134
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.
96
135
97
-
You can use the `max_retries` option to configure or disable this:
136
+
You can use the `maxRetries` option to configure or disable this:
98
137
99
138
```php
100
139
<?php
101
140
102
141
use BeeperDesktop\Client;
103
-
use BeeperDesktop\RequestOptions;
104
142
105
143
// Configure the default for all requests:
106
-
$client = new Client(maxRetries: 0);
144
+
$client = new Client(requestOptions: ['maxRetries' => 0]);
0 commit comments