Skip to content

Latest commit

 

History

History
228 lines (176 loc) · 7.27 KB

ApiKeysApi.md

File metadata and controls

228 lines (176 loc) · 7.27 KB

ApiKeysApi

All URIs are relative to http://localhost

Method HTTP request Description
apiKeysCreateApiKey POST /api/manage/v1/ApiKeys Create a new apikey, 5 apikeys for user. Hardcoded for ddos.
apiKeysDeleteApiKey DELETE /api/manage/v1/ApiKeys Delete an apikey
apiKeysGetApiKeys GET /api/manage/v1/ApiKeys Returns list with all apikeys of current user

apiKeysCreateApiKey

ApiKeyVM apiKeysCreateApiKey(createApiKeyVM)

Create a new apikey, 5 apikeys for user. Hardcoded for ddos.

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.ApiKeysApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: ApiKey
    HttpBasicAuth ApiKey = (HttpBasicAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setUsername("YOUR USERNAME");
    ApiKey.setPassword("YOUR PASSWORD");

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    ApiKeysApi apiInstance = new ApiKeysApi(defaultClient);
    CreateApiKeyVM createApiKeyVM = new CreateApiKeyVM(); // CreateApiKeyVM | 
    try {
      ApiKeyVM result = apiInstance.apiKeysCreateApiKey(createApiKeyVM);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApiKeysApi#apiKeysCreateApiKey");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
createApiKeyVM CreateApiKeyVM

Return type

ApiKeyVM

Authorization

ApiKey, JWT

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Succesfully created -
400 wrong model provided or exception thrown (user's attempts to create sixth key for example throwns an exception) -
401 User is not authorized -

apiKeysDeleteApiKey

ApiKeyVM apiKeysDeleteApiKey(deleteApiKeyVM)

Delete an apikey

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.ApiKeysApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: ApiKey
    HttpBasicAuth ApiKey = (HttpBasicAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setUsername("YOUR USERNAME");
    ApiKey.setPassword("YOUR PASSWORD");

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    ApiKeysApi apiInstance = new ApiKeysApi(defaultClient);
    DeleteApiKeyVM deleteApiKeyVM = new DeleteApiKeyVM(); // DeleteApiKeyVM | 
    try {
      ApiKeyVM result = apiInstance.apiKeysDeleteApiKey(deleteApiKeyVM);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApiKeysApi#apiKeysDeleteApiKey");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
deleteApiKeyVM DeleteApiKeyVM

Return type

ApiKeyVM

Authorization

ApiKey, JWT

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 The request is wrong -
401 User is not authorized -
404 No such apikey found -
500 exception thrown -
204 Succesfully deleted -

apiKeysGetApiKeys

ApiKeysVM apiKeysGetApiKeys()

Returns list with all apikeys of current user

Always work, it should make only 200 response (except if user is not authorized).

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.ApiKeysApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: ApiKey
    HttpBasicAuth ApiKey = (HttpBasicAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setUsername("YOUR USERNAME");
    ApiKey.setPassword("YOUR PASSWORD");

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    ApiKeysApi apiInstance = new ApiKeysApi(defaultClient);
    try {
      ApiKeysVM result = apiInstance.apiKeysGetApiKeys();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApiKeysApi#apiKeysGetApiKeys");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

ApiKeysVM

Authorization

ApiKey, JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Succesfully retured -
401 User is not authorized -
500 Exception somehow thrown (barely possible) -