Skip to content

Latest commit

 

History

History
228 lines (155 loc) · 6.64 KB

NewsApi.md

File metadata and controls

228 lines (155 loc) · 6.64 KB

forestvpn_api.api.NewsApi

Load the API package

import 'package:forestvpn_api/api.dart';

All URIs are relative to https://api.forestvpn.com/v2

Method HTTP request Description
getNotification GET /news/notifications/{notificationID}/ Get notification content
getNotificationsUnreadCount GET /news/unread_count/ Get unread notifications count
listNotifications GET /news/notifications/ Get notifications list
updateNotificationMarkRead PATCH /news/notifications/{notificationID}/mark_read/ Mark notification as read by user
updateNotificationMarkReadAll PATCH /news/notifications/mark_read_all/ Mark all notifications as read by user

getNotification

NotificationDetail getNotification(notificationID)

Get notification content

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getNewsApi();
final int notificationID = 56; // int | 

try {
    final response = api.getNotification(notificationID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling NewsApi->getNotification: $e\n');
}

Parameters

Name Type Description Notes
notificationID int

Return type

NotificationDetail

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getNotificationsUnreadCount

NotificationUnreadCount getNotificationsUnreadCount()

Get unread notifications count

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getNewsApi();

try {
    final response = api.getNotificationsUnreadCount();
    print(response);
} catch on DioError (e) {
    print('Exception when calling NewsApi->getNotificationsUnreadCount: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

NotificationUnreadCount

Authorization

bearerAuth

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

BuiltList listNotifications(isPublished)

Get notifications list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getNewsApi();
final bool isPublished = true; // bool | 

try {
    final response = api.listNotifications(isPublished);
    print(response);
} catch on DioError (e) {
    print('Exception when calling NewsApi->listNotifications: $e\n');
}

Parameters

Name Type Description Notes
isPublished bool [optional]

Return type

BuiltList<Notification>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateNotificationMarkRead

updateNotificationMarkRead(notificationID)

Mark notification as read by user

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getNewsApi();
final int notificationID = 56; // int | 

try {
    api.updateNotificationMarkRead(notificationID);
} catch on DioError (e) {
    print('Exception when calling NewsApi->updateNotificationMarkRead: $e\n');
}

Parameters

Name Type Description Notes
notificationID int

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateNotificationMarkReadAll

updateNotificationMarkReadAll()

Mark all notifications as read by user

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getNewsApi();

try {
    api.updateNotificationMarkReadAll();
} catch on DioError (e) {
    print('Exception when calling NewsApi->updateNotificationMarkReadAll: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]