415 lines
17 KiB
Markdown
Executable File
415 lines
17 KiB
Markdown
Executable File
# MiscellaneousApi
|
|
|
|
All URIs are relative to *http://localhost/api/v1*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**getSigningKey**](MiscellaneousApi.md#getSigningKey) | **GET** /signing-key.gpg | Get default signing-key.gpg
|
|
[**getVersion**](MiscellaneousApi.md#getVersion) | **GET** /version | Returns the version of the Gitea application
|
|
[**renderMarkdown**](MiscellaneousApi.md#renderMarkdown) | **POST** /markdown | Render a markdown document as HTML
|
|
[**renderMarkdownRaw**](MiscellaneousApi.md#renderMarkdownRaw) | **POST** /markdown/raw | Render raw markdown as HTML
|
|
|
|
|
|
<a name="getSigningKey"></a>
|
|
# **getSigningKey**
|
|
> String getSigningKey()
|
|
|
|
Get default signing-key.gpg
|
|
|
|
### Example
|
|
```java
|
|
// Import classes:
|
|
import io.gitea.ApiClient;
|
|
import io.gitea.ApiException;
|
|
import io.gitea.Configuration;
|
|
import io.gitea.auth.*;
|
|
import io.gitea.models.*;
|
|
import io.gitea.api.MiscellaneousApi;
|
|
|
|
public class Example {
|
|
public static void main(String[] args) {
|
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
|
defaultClient.setBasePath("http://localhost/api/v1");
|
|
|
|
// Configure API key authorization: AccessToken
|
|
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
|
|
AccessToken.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//AccessToken.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: AuthorizationHeaderToken
|
|
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
|
|
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//AuthorizationHeaderToken.setApiKeyPrefix("Token");
|
|
|
|
// Configure HTTP basic authorization: BasicAuth
|
|
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
|
|
BasicAuth.setUsername("YOUR USERNAME");
|
|
BasicAuth.setPassword("YOUR PASSWORD");
|
|
|
|
// Configure API key authorization: SudoHeader
|
|
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
|
|
SudoHeader.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//SudoHeader.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: SudoParam
|
|
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
|
|
SudoParam.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//SudoParam.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: TOTPHeader
|
|
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
|
|
TOTPHeader.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//TOTPHeader.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: Token
|
|
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
|
|
Token.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//Token.setApiKeyPrefix("Token");
|
|
|
|
MiscellaneousApi apiInstance = new MiscellaneousApi(defaultClient);
|
|
try {
|
|
String result = apiInstance.getSigningKey();
|
|
System.out.println(result);
|
|
} catch (ApiException e) {
|
|
System.err.println("Exception when calling MiscellaneousApi#getSigningKey");
|
|
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
|
|
|
|
**String**
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: text/plain
|
|
|
|
### HTTP response details
|
|
| Status code | Description | Response headers |
|
|
|-------------|-------------|------------------|
|
|
**200** | GPG armored public key | - |
|
|
|
|
<a name="getVersion"></a>
|
|
# **getVersion**
|
|
> ServerVersion getVersion()
|
|
|
|
Returns the version of the Gitea application
|
|
|
|
### Example
|
|
```java
|
|
// Import classes:
|
|
import io.gitea.ApiClient;
|
|
import io.gitea.ApiException;
|
|
import io.gitea.Configuration;
|
|
import io.gitea.auth.*;
|
|
import io.gitea.models.*;
|
|
import io.gitea.api.MiscellaneousApi;
|
|
|
|
public class Example {
|
|
public static void main(String[] args) {
|
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
|
defaultClient.setBasePath("http://localhost/api/v1");
|
|
|
|
// Configure API key authorization: AccessToken
|
|
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
|
|
AccessToken.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//AccessToken.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: AuthorizationHeaderToken
|
|
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
|
|
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//AuthorizationHeaderToken.setApiKeyPrefix("Token");
|
|
|
|
// Configure HTTP basic authorization: BasicAuth
|
|
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
|
|
BasicAuth.setUsername("YOUR USERNAME");
|
|
BasicAuth.setPassword("YOUR PASSWORD");
|
|
|
|
// Configure API key authorization: SudoHeader
|
|
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
|
|
SudoHeader.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//SudoHeader.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: SudoParam
|
|
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
|
|
SudoParam.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//SudoParam.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: TOTPHeader
|
|
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
|
|
TOTPHeader.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//TOTPHeader.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: Token
|
|
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
|
|
Token.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//Token.setApiKeyPrefix("Token");
|
|
|
|
MiscellaneousApi apiInstance = new MiscellaneousApi(defaultClient);
|
|
try {
|
|
ServerVersion result = apiInstance.getVersion();
|
|
System.out.println(result);
|
|
} catch (ApiException e) {
|
|
System.err.println("Exception when calling MiscellaneousApi#getVersion");
|
|
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
|
|
|
|
[**ServerVersion**](ServerVersion.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
### HTTP response details
|
|
| Status code | Description | Response headers |
|
|
|-------------|-------------|------------------|
|
|
**200** | ServerVersion | - |
|
|
|
|
<a name="renderMarkdown"></a>
|
|
# **renderMarkdown**
|
|
> String renderMarkdown(body)
|
|
|
|
Render a markdown document as HTML
|
|
|
|
### Example
|
|
```java
|
|
// Import classes:
|
|
import io.gitea.ApiClient;
|
|
import io.gitea.ApiException;
|
|
import io.gitea.Configuration;
|
|
import io.gitea.auth.*;
|
|
import io.gitea.models.*;
|
|
import io.gitea.api.MiscellaneousApi;
|
|
|
|
public class Example {
|
|
public static void main(String[] args) {
|
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
|
defaultClient.setBasePath("http://localhost/api/v1");
|
|
|
|
// Configure API key authorization: AccessToken
|
|
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
|
|
AccessToken.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//AccessToken.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: AuthorizationHeaderToken
|
|
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
|
|
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//AuthorizationHeaderToken.setApiKeyPrefix("Token");
|
|
|
|
// Configure HTTP basic authorization: BasicAuth
|
|
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
|
|
BasicAuth.setUsername("YOUR USERNAME");
|
|
BasicAuth.setPassword("YOUR PASSWORD");
|
|
|
|
// Configure API key authorization: SudoHeader
|
|
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
|
|
SudoHeader.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//SudoHeader.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: SudoParam
|
|
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
|
|
SudoParam.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//SudoParam.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: TOTPHeader
|
|
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
|
|
TOTPHeader.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//TOTPHeader.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: Token
|
|
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
|
|
Token.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//Token.setApiKeyPrefix("Token");
|
|
|
|
MiscellaneousApi apiInstance = new MiscellaneousApi(defaultClient);
|
|
MarkdownOption body = new MarkdownOption(); // MarkdownOption |
|
|
try {
|
|
String result = apiInstance.renderMarkdown(body);
|
|
System.out.println(result);
|
|
} catch (ApiException e) {
|
|
System.err.println("Exception when calling MiscellaneousApi#renderMarkdown");
|
|
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
|
|
------------- | ------------- | ------------- | -------------
|
|
**body** | [**MarkdownOption**](MarkdownOption.md)| | [optional]
|
|
|
|
### Return type
|
|
|
|
**String**
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: text/html
|
|
|
|
### HTTP response details
|
|
| Status code | Description | Response headers |
|
|
|-------------|-------------|------------------|
|
|
**200** | MarkdownRender is a rendered markdown document | - |
|
|
**422** | APIValidationError is error format response related to input validation | * message - <br> * url - <br> |
|
|
|
|
<a name="renderMarkdownRaw"></a>
|
|
# **renderMarkdownRaw**
|
|
> String renderMarkdownRaw(body)
|
|
|
|
Render raw markdown as HTML
|
|
|
|
### Example
|
|
```java
|
|
// Import classes:
|
|
import io.gitea.ApiClient;
|
|
import io.gitea.ApiException;
|
|
import io.gitea.Configuration;
|
|
import io.gitea.auth.*;
|
|
import io.gitea.models.*;
|
|
import io.gitea.api.MiscellaneousApi;
|
|
|
|
public class Example {
|
|
public static void main(String[] args) {
|
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
|
defaultClient.setBasePath("http://localhost/api/v1");
|
|
|
|
// Configure API key authorization: AccessToken
|
|
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
|
|
AccessToken.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//AccessToken.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: AuthorizationHeaderToken
|
|
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
|
|
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//AuthorizationHeaderToken.setApiKeyPrefix("Token");
|
|
|
|
// Configure HTTP basic authorization: BasicAuth
|
|
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
|
|
BasicAuth.setUsername("YOUR USERNAME");
|
|
BasicAuth.setPassword("YOUR PASSWORD");
|
|
|
|
// Configure API key authorization: SudoHeader
|
|
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
|
|
SudoHeader.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//SudoHeader.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: SudoParam
|
|
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
|
|
SudoParam.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//SudoParam.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: TOTPHeader
|
|
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
|
|
TOTPHeader.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//TOTPHeader.setApiKeyPrefix("Token");
|
|
|
|
// Configure API key authorization: Token
|
|
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
|
|
Token.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//Token.setApiKeyPrefix("Token");
|
|
|
|
MiscellaneousApi apiInstance = new MiscellaneousApi(defaultClient);
|
|
String body = "body_example"; // String | Request body to render
|
|
try {
|
|
String result = apiInstance.renderMarkdownRaw(body);
|
|
System.out.println(result);
|
|
} catch (ApiException e) {
|
|
System.err.println("Exception when calling MiscellaneousApi#renderMarkdownRaw");
|
|
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
|
|
------------- | ------------- | ------------- | -------------
|
|
**body** | **String**| Request body to render |
|
|
|
|
### Return type
|
|
|
|
**String**
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: text/plain
|
|
- **Accept**: text/html
|
|
|
|
### HTTP response details
|
|
| Status code | Description | Response headers |
|
|
|-------------|-------------|------------------|
|
|
**200** | MarkdownRender is a rendered markdown document | - |
|
|
**422** | APIValidationError is error format response related to input validation | * message - <br> * url - <br> |
|
|
|