9.0 KiB
openapi.api.DefaultApi
Load the API package
import 'package:openapi/api.dart';
All URIs are relative to https://localhost:8080/ocs/v1.php/apps/notifications
Method | HTTP request | Description |
---|---|---|
deleteAllNotifications | DELETE /api/v2/notifications | |
deleteNotification | DELETE /api/v2/notifications/{id} | |
getNotification | GET /api/v2/notifications/{id} | |
listNotifications | GET /api/v2/notifications | |
registerDevice | POST /api/v2/push | |
removeDevice | DELETE /api/v2/push | |
sendAdminNotification | POST /api/v2/admin_notifications/{userId} |
deleteAllNotifications
String deleteAllNotifications()
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: basic_auth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').password = 'YOUR_PASSWORD';
final api_instance = DefaultApi();
try {
final result = api_instance.deleteAllNotifications();
print(result);
} catch (e) {
print('Exception when calling DefaultApi->deleteAllNotifications: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
String
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteNotification
NotificationsEmpty deleteNotification(id)
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: basic_auth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').password = 'YOUR_PASSWORD';
final api_instance = DefaultApi();
final id = 56; // int |
try {
final result = api_instance.deleteNotification(id);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->deleteNotification: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getNotification
NotificationsGetNotification getNotification(id)
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: basic_auth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').password = 'YOUR_PASSWORD';
final api_instance = DefaultApi();
final id = 56; // int |
try {
final result = api_instance.getNotification(id);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->getNotification: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listNotifications
NotificationsListNotifications listNotifications()
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: basic_auth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').password = 'YOUR_PASSWORD';
final api_instance = DefaultApi();
try {
final result = api_instance.listNotifications();
print(result);
} catch (e) {
print('Exception when calling DefaultApi->listNotifications: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
NotificationsListNotifications
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
registerDevice
NotificationsPushServerRegistration registerDevice(pushTokenHash, devicePublicKey, proxyServer)
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: basic_auth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').password = 'YOUR_PASSWORD';
final api_instance = DefaultApi();
final pushTokenHash = pushTokenHash_example; // String |
final devicePublicKey = devicePublicKey_example; // String |
final proxyServer = proxyServer_example; // String |
try {
final result = api_instance.registerDevice(pushTokenHash, devicePublicKey, proxyServer);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->registerDevice: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
pushTokenHash | String | ||
devicePublicKey | String | ||
proxyServer | String |
Return type
NotificationsPushServerRegistration
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
removeDevice
String removeDevice()
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: basic_auth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').password = 'YOUR_PASSWORD';
final api_instance = DefaultApi();
try {
final result = api_instance.removeDevice();
print(result);
} catch (e) {
print('Exception when calling DefaultApi->removeDevice: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
String
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
sendAdminNotification
NotificationsEmpty sendAdminNotification(userId, shortMessage, longMessage)
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: basic_auth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basic_auth').password = 'YOUR_PASSWORD';
final api_instance = DefaultApi();
final userId = userId_example; // String |
final shortMessage = shortMessage_example; // String |
final longMessage = longMessage_example; // String |
try {
final result = api_instance.sendAdminNotification(userId, shortMessage, longMessage);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->sendAdminNotification: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
userId | String | ||
shortMessage | String | ||
longMessage | String | [optional] [default to ''] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]