open-project-flutter-api/doc/PreviewingApi.md
2023-11-05 19:54:17 +01:00

3.5 KiB

openapi.api.PreviewingApi

Load the API package

import 'package:openapi/api.dart';

All URIs are relative to https://community.openproject.org

Method HTTP request Description
previewMarkdownDocument POST /api/v3/render/markdown Preview Markdown document
previewPlainDocument POST /api/v3/render/plain Preview plain document

previewMarkdownDocument

String previewMarkdownDocument(context)

Preview Markdown document

Example

import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';

final api_instance = PreviewingApi();
final context = /api/v3/work_packages/42; // String | API-Link to the context in which the rendering occurs, for example a specific work package.  If left out only context-agnostic rendering takes place. Please note that OpenProject features markdown-extensions on top of the extensions GitHub Flavored Markdown (gfm) already provides that can only work given a context (e.g. display attached images).  **Supported contexts:**  * `/api/v3/work_packages/{id}` - an existing work package

try {
    final result = api_instance.previewMarkdownDocument(context);
    print(result);
} catch (e) {
    print('Exception when calling PreviewingApi->previewMarkdownDocument: $e\n');
}

Parameters

Name Type Description Notes
context String API-Link to the context in which the rendering occurs, for example a specific work package. If left out only context-agnostic rendering takes place. Please note that OpenProject features markdown-extensions on top of the extensions GitHub Flavored Markdown (gfm) already provides that can only work given a context (e.g. display attached images). Supported contexts: * /api/v3/work_packages/{id} - an existing work package [optional]

Return type

String

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/html, application/hal+json

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

previewPlainDocument

String previewPlainDocument()

Preview plain document

Example

import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';

final api_instance = PreviewingApi();

try {
    final result = api_instance.previewPlainDocument();
    print(result);
} catch (e) {
    print('Exception when calling PreviewingApi->previewPlainDocument: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

String

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/html, application/hal+json

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