Skip to content

Latest commit

 

History

History
98 lines (66 loc) · 2.76 KB

AppApi.md

File metadata and controls

98 lines (66 loc) · 2.76 KB

forestvpn_api.api.AppApi

Load the API package

import 'package:forestvpn_api/api.dart';

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

Method HTTP request Description
getCurrentUserDevice GET /app/devices/current/ Get user device info
updateCurrentUserDevice PATCH /app/devices/current/ Update user device

getCurrentUserDevice

UserDevice getCurrentUserDevice()

Get user device info

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().getAppApi();

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

Parameters

This endpoint does not need any parameter.

Return type

UserDevice

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]

updateCurrentUserDevice

updateCurrentUserDevice(updateUserDeviceRequest)

Update user device

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().getAppApi();
final UpdateUserDeviceRequest updateUserDeviceRequest = ; // UpdateUserDeviceRequest | 

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

Parameters

Name Type Description Notes
updateUserDeviceRequest UpdateUserDeviceRequest

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

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

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