getTextContent
Get the XML content of a given text
/api/texts/{textSlug}/{view}/whole/whole/
Usage and SDK Samples
curl -X GET "https://cotr.ac.uk/api/texts/{textSlug}/{view}/whole/whole/"
import .*;
import .auth.*;
import .model.*;
import .api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String textSlug = edinburgh-nls-ms-adv-3517-pp345346; // String | slug of a text
String view = transcription; // String | the type of encoding or edition: transcription for Latin or translation for English
try {
TextContentResponse result = apiInstance.getTextContent(textSlug, view);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#getTextContent");
e.printStackTrace();
}
}
}
import .api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String textSlug = edinburgh-nls-ms-adv-3517-pp345346; // String | slug of a text
String view = transcription; // String | the type of encoding or edition: transcription for Latin or translation for English
try {
TextContentResponse result = apiInstance.getTextContent(textSlug, view);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#getTextContent");
e.printStackTrace();
}
}
}
String *textSlug = edinburgh-nls-ms-adv-3517-pp345346; // slug of a text (default to null)
String *view = transcription; // the type of encoding or edition: transcription for Latin or translation for English (default to null)
DefaultApi *apiInstance = [[DefaultApi alloc] init];
// Get the XML content of a given text
[apiInstance getTextContentWith:textSlug
view:view
completionHandler: ^(TextContentResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var CotrWebApi = require('cotr_web_api');
var api = new CotrWebApi.DefaultApi()
var textSlug = edinburgh-nls-ms-adv-3517-pp345346; // {String} slug of a text
var view = transcription; // {String} the type of encoding or edition: transcription for Latin or translation for English
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getTextContent(textSlug, view, callback);
using System;
using System.Diagnostics;
using .Api;
using .Client;
using .Model;
namespace Example
{
public class getTextContentExample
{
public void main()
{
var apiInstance = new DefaultApi();
var textSlug = edinburgh-nls-ms-adv-3517-pp345346; // String | slug of a text (default to null)
var view = transcription; // String | the type of encoding or edition: transcription for Latin or translation for English (default to null)
try
{
// Get the XML content of a given text
TextContentResponse result = apiInstance.getTextContent(textSlug, view);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.getTextContent: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$textSlug = edinburgh-nls-ms-adv-3517-pp345346; // String | slug of a text
$view = transcription; // String | the type of encoding or edition: transcription for Latin or translation for English
try {
$result = $api_instance->getTextContent($textSlug, $view);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getTextContent: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use ::Configuration;
use ::DefaultApi;
my $api_instance = ::DefaultApi->new();
my $textSlug = edinburgh-nls-ms-adv-3517-pp345346; # String | slug of a text
my $view = transcription; # String | the type of encoding or edition: transcription for Latin or translation for English
eval {
my $result = $api_instance->getTextContent(textSlug => $textSlug, view => $view);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DefaultApi->getTextContent: $@\n";
}
from __future__ import print_statement
import time
import
from .rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = .DefaultApi()
textSlug = edinburgh-nls-ms-adv-3517-pp345346 # String | slug of a text (default to null)
view = transcription # String | the type of encoding or edition: transcription for Latin or translation for English (default to null)
try:
# Get the XML content of a given text
api_response = api_instance.get_text_content(textSlug, view)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->getTextContent: %s\n" % e)
extern crate DefaultApi;
pub fn main() {
let textSlug = edinburgh-nls-ms-adv-3517-pp345346; // String
let view = transcription; // String
let mut context = DefaultApi::Context::default();
let result = client.getTextContent(textSlug, view, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Path parameters
| Name | Description |
|---|---|
| textSlug* |
String
slug of a text
Required
|
| view* |
String
the type of encoding or edition: transcription for Latin or translation for English
Required
|