Skip to content

Latest commit

 

History

History
157 lines (108 loc) · 3.69 KB

AuthApi.md

File metadata and controls

157 lines (108 loc) · 3.69 KB

AuthApi

All URIs are relative to http://localhost/api/v1

Method HTTP request Description
createToken POST /auth/token
deleteToken DELETE /auth/token
me GET /auth/me

createToken

TokenResponse createToken(credential)

Creates a new token

Example

// Import classes:
//import io.github.triglav_dataflow.client.ApiException;
//import io.github.triglav_dataflow.client.api.AuthApi;


AuthApi apiInstance = new AuthApi();
Credential credential = new Credential(); // Credential | 
try {
    TokenResponse result = apiInstance.createToken(credential);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AuthApi#createToken");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
credential Credential

Return type

TokenResponse

Authorization

No authorization required

HTTP request headers

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

deleteToken

deleteToken()

Deletes (Expires) a token of header

Example

// Import classes:
//import io.github.triglav_dataflow.client.ApiClient;
//import io.github.triglav_dataflow.client.ApiException;
//import io.github.triglav_dataflow.client.Configuration;
//import io.github.triglav_dataflow.client.auth.*;
//import io.github.triglav_dataflow.client.api.AuthApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");

AuthApi apiInstance = new AuthApi();
try {
    apiInstance.deleteToken();
} catch (ApiException e) {
    System.err.println("Exception when calling AuthApi#deleteToken");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

api_key

HTTP request headers

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

me

UserResponse me()

Returns a user property of the access_token

Example

// Import classes:
//import io.github.triglav_dataflow.client.ApiClient;
//import io.github.triglav_dataflow.client.ApiException;
//import io.github.triglav_dataflow.client.Configuration;
//import io.github.triglav_dataflow.client.auth.*;
//import io.github.triglav_dataflow.client.api.AuthApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");

AuthApi apiInstance = new AuthApi();
try {
    UserResponse result = apiInstance.me();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AuthApi#me");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

UserResponse

Authorization

api_key

HTTP request headers

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