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: docs/usage.md
+56-42Lines changed: 56 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -219,9 +219,15 @@ try {
219
219
220
220
### Mid-level API
221
221
222
-
You can now use the `getApi()` method to create and get a specific Redmine API. This simplifies common use-cases and gives you some features like caching and assigning a user to an issue by username instead of the user ID.
222
+
You can now use the `getApi()` method to create and get a specific Redmine API.
223
223
224
-
To check for failed requests you can afterwards check the status code via `$client->getLastResponseStatusCode()`.
224
+
```php
225
+
$api = $client->getApi('issue');
226
+
```
227
+
228
+
This simplifies common use-cases and gives you some features like caching and assigning a user to an issue by username instead of the user ID.
229
+
230
+
To check for failed requests you can afterwards check the status code via `$api->getLastResponse()->getStatusCode()`.
225
231
226
232
#### Tracker API
227
233
@@ -646,68 +652,76 @@ The low-level API allows you to send highly customized requests to the Redmine s
646
652
647
653
> :bulb: See the [Redmine REST-API docs](https://www.redmine.org/projects/redmine/wiki/Rest_api) for available endpoints and required parameters.
Using this methods you can use every Redmine API endpoint. The following example shows you how to rename a project and add a custom field. To build the XML body you can use the `XmlSerializer`.
659
+
There is also a `HttpFactory` to create `Request` objects:
660
+
661
+
-`\Redmine\Http\HttpFactory::makeJsonRequest()` creates a `\Redmine\Http\Request` instance for JSON requests
662
+
-`\Redmine\Http\HttpFactory::makeXmlRequest()` creates a `\Redmine\Http\Request` instance for XML requests
663
+
664
+
Using this method and the `HttpFactory` you can use every Redmine API endpoint. The following example shows you how to rename a project and add a custom field. To build the XML body you can use the `XmlSerializer`.
0 commit comments