mirror of
https://github.com/gosticks/open-project-flutter-api.git
synced 2025-10-16 11:55:34 +00:00
112 lines
3.6 KiB
Markdown
112 lines
3.6 KiB
Markdown
# openapi.api.DocumentsApi
|
|
|
|
## Load the API package
|
|
```dart
|
|
import 'package:openapi/api.dart';
|
|
```
|
|
|
|
All URIs are relative to *https://community.openproject.org*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**listDocuments**](DocumentsApi.md#listdocuments) | **GET** /api/v3/documents | List Documents
|
|
[**viewDocument**](DocumentsApi.md#viewdocument) | **GET** /api/v3/documents/{id} | View document
|
|
|
|
|
|
# **listDocuments**
|
|
> Object listDocuments(offset, pageSize, sortBy)
|
|
|
|
List Documents
|
|
|
|
The documents returned depend on the provided parameters and also on the requesting user's permissions.
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:openapi/api.dart';
|
|
// TODO Configure HTTP basic authorization: BasicAuth
|
|
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
|
|
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
|
|
|
|
final api_instance = DocumentsApi();
|
|
final offset = 25; // int | Page number inside the requested collection.
|
|
final pageSize = 25; // int | Number of elements to display per page.
|
|
final sortBy = [["created_at", "asc"]]; // String | JSON specifying sort criteria. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported sorts are: + id: Sort by primary key + created_at: Sort by document creation datetime
|
|
|
|
try {
|
|
final result = api_instance.listDocuments(offset, pageSize, sortBy);
|
|
print(result);
|
|
} catch (e) {
|
|
print('Exception when calling DocumentsApi->listDocuments: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**offset** | **int**| Page number inside the requested collection. | [optional] [default to 1]
|
|
**pageSize** | **int**| Number of elements to display per page. | [optional]
|
|
**sortBy** | **String**| JSON specifying sort criteria. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported sorts are: + id: Sort by primary key + created_at: Sort by document creation datetime | [optional]
|
|
|
|
### Return type
|
|
|
|
[**Object**](Object.md)
|
|
|
|
### Authorization
|
|
|
|
[BasicAuth](../README.md#BasicAuth)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/hal+json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **viewDocument**
|
|
> DocumentModel viewDocument(id)
|
|
|
|
View document
|
|
|
|
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:openapi/api.dart';
|
|
// TODO Configure HTTP basic authorization: BasicAuth
|
|
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
|
|
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
|
|
|
|
final api_instance = DocumentsApi();
|
|
final id = 1; // int | Document id
|
|
|
|
try {
|
|
final result = api_instance.viewDocument(id);
|
|
print(result);
|
|
} catch (e) {
|
|
print('Exception when calling DocumentsApi->viewDocument: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**id** | **int**| Document id |
|
|
|
|
### Return type
|
|
|
|
[**DocumentModel**](DocumentModel.md)
|
|
|
|
### Authorization
|
|
|
|
[BasicAuth](../README.md#BasicAuth)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/hal+json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|