Skip to content

Latest commit

 

History

History
166 lines (128 loc) · 6.49 KB

File metadata and controls

166 lines (128 loc) · 6.49 KB

RenderingApi

All URIs are relative to http://localhost

Method HTTP request Description
getRenderedEntitiesFromText POST /preview Get Rendered Entities From Text
getRenderedEntitiesFromTrainerExport POST /preview_trainer_export Get Rendered Entities From Trainer Export

getRenderedEntitiesFromText

getRenderedEntitiesFromText(body, trackingId)

Get Rendered Entities From Text

Extract the NER entities in HTML for preview

Example

// Import classes:
import org.cms.client.ApiClient;
import org.cms.client.ApiException;
import org.cms.client.Configuration;
import org.cms.client.auth.*;
import org.cms.client.models.*;
import org.cms.client.api.RenderingApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure OAuth2 access token for authorization: OAuth2PasswordBearer
    OAuth OAuth2PasswordBearer = (OAuth) defaultClient.getAuthentication("OAuth2PasswordBearer");
    OAuth2PasswordBearer.setAccessToken("YOUR ACCESS TOKEN");

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

    RenderingApi apiInstance = new RenderingApi(defaultClient);
    String body = "body_example"; // String | 
    String trackingId = "trackingId_example"; // String | The tracking ID of the requested task
    try {
      apiInstance.getRenderedEntitiesFromText(body, trackingId);
    } catch (ApiException e) {
      System.err.println("Exception when calling RenderingApi#getRenderedEntitiesFromText");
      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
trackingId String The tracking ID of the requested task [optional]

Return type

null (empty response body)

Authorization

OAuth2PasswordBearer, APIKeyCookie

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

getRenderedEntitiesFromTrainerExport

getRenderedEntitiesFromTrainerExport(projectId, documentId, trackingId, trainerExport, trainerExportStr)

Get Rendered Entities From Trainer Export

Get existing entities in HTML from a trainer export for preview

Example

// Import classes:
import org.cms.client.ApiClient;
import org.cms.client.ApiException;
import org.cms.client.Configuration;
import org.cms.client.auth.*;
import org.cms.client.models.*;
import org.cms.client.api.RenderingApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure OAuth2 access token for authorization: OAuth2PasswordBearer
    OAuth OAuth2PasswordBearer = (OAuth) defaultClient.getAuthentication("OAuth2PasswordBearer");
    OAuth2PasswordBearer.setAccessToken("YOUR ACCESS TOKEN");

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

    RenderingApi apiInstance = new RenderingApi(defaultClient);
    Integer projectId = 56; // Integer | The target project ID, and if not provided, all projects will be included
    Integer documentId = 56; // Integer | The target document ID, and if not provided, all documents of the target project(s) will be included
    String trackingId = "trackingId_example"; // String | The tracking ID of the requested task
    List<File> trainerExport = Arrays.asList(); // List<File> | One or more trainer export files to be uploaded
    String trainerExportStr = "{\\\"projects\\\": []}"; // String | The trainer export raw JSON string
    try {
      apiInstance.getRenderedEntitiesFromTrainerExport(projectId, documentId, trackingId, trainerExport, trainerExportStr);
    } catch (ApiException e) {
      System.err.println("Exception when calling RenderingApi#getRenderedEntitiesFromTrainerExport");
      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
projectId Integer The target project ID, and if not provided, all projects will be included [optional]
documentId Integer The target document ID, and if not provided, all documents of the target project(s) will be included [optional]
trackingId String The tracking ID of the requested task [optional]
trainerExport List<File> One or more trainer export files to be uploaded [optional]
trainerExportStr String The trainer export raw JSON string [optional] [default to {&quot;projects&quot;: []}]

Return type

null (empty response body)

Authorization

OAuth2PasswordBearer, APIKeyCookie

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -