Skip to content

Latest commit

 

History

History
280 lines (202 loc) · 6.2 KB

AuthForestVPNAPI.md

File metadata and controls

280 lines (202 loc) · 6.2 KB

AuthForestVPNAPI

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

Method HTTP request Description
loginToken POST /auth/token/login/ Login with JWT token
migrateLegacyAuth GET /legacy/auth/ Legacy auth migration
obtainToken GET /auth/token/obtain/ Obtain JWT token
updateUserProfile PATCH /auth/profile/ Update profile
userProfile GET /auth/profile/ Profile
whoAmI GET /auth/whoami/ Who am I

loginToken

TokenLogin loginToken(createTokenLogin)

Login with JWT token

Example

// Import classes:
//import com.forestvpn.api.client.infrastructure.*
//import com.forestvpn.api.client.models.*

val apiInstance = AuthForestVPNAPI()
val createTokenLogin : CreateTokenLogin =  // CreateTokenLogin | 
try {
    val result : TokenLogin = apiInstance.loginToken(createTokenLogin)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling AuthForestVPNAPI#loginToken")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling AuthForestVPNAPI#loginToken")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
createTokenLogin CreateTokenLogin [optional]

Return type

TokenLogin

Authorization

Configure bearerAuth: ApiClient.accessToken = ""

HTTP request headers

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

migrateLegacyAuth

LegacyAuthMigrationToken migrateLegacyAuth()

Legacy auth migration

Example

// Import classes:
//import com.forestvpn.api.client.infrastructure.*
//import com.forestvpn.api.client.models.*

val apiInstance = AuthForestVPNAPI()
try {
    val result : LegacyAuthMigrationToken = apiInstance.migrateLegacyAuth()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling AuthForestVPNAPI#migrateLegacyAuth")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling AuthForestVPNAPI#migrateLegacyAuth")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

LegacyAuthMigrationToken

Authorization

Configure bearerAuth: ApiClient.accessToken = ""

HTTP request headers

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

obtainToken

TokenObtain obtainToken()

Obtain JWT token

Example

// Import classes:
//import com.forestvpn.api.client.infrastructure.*
//import com.forestvpn.api.client.models.*

val apiInstance = AuthForestVPNAPI()
try {
    val result : TokenObtain = apiInstance.obtainToken()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling AuthForestVPNAPI#obtainToken")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling AuthForestVPNAPI#obtainToken")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

TokenObtain

Authorization

Configure bearerAuth: ApiClient.accessToken = ""

HTTP request headers

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

updateUserProfile

User updateUserProfile(user)

Update profile

Example

// Import classes:
//import com.forestvpn.api.client.infrastructure.*
//import com.forestvpn.api.client.models.*

val apiInstance = AuthForestVPNAPI()
val user : User =  // User | 
try {
    val result : User = apiInstance.updateUserProfile(user)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling AuthForestVPNAPI#updateUserProfile")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling AuthForestVPNAPI#updateUserProfile")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
user User [optional]

Return type

User

Authorization

Configure bearerAuth: ApiClient.accessToken = ""

HTTP request headers

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

userProfile

User userProfile()

Profile

Example

// Import classes:
//import com.forestvpn.api.client.infrastructure.*
//import com.forestvpn.api.client.models.*

val apiInstance = AuthForestVPNAPI()
try {
    val result : User = apiInstance.userProfile()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling AuthForestVPNAPI#userProfile")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling AuthForestVPNAPI#userProfile")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

User

Authorization

Configure bearerAuth: ApiClient.accessToken = ""

HTTP request headers

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

whoAmI

User whoAmI()

Who am I

Example

// Import classes:
//import com.forestvpn.api.client.infrastructure.*
//import com.forestvpn.api.client.models.*

val apiInstance = AuthForestVPNAPI()
try {
    val result : User = apiInstance.whoAmI()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling AuthForestVPNAPI#whoAmI")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling AuthForestVPNAPI#whoAmI")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

User

Authorization

Configure bearerAuth: ApiClient.accessToken = ""

HTTP request headers

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