Apitext is a student built prototype RESTful Application Programing Interface (API) for TEI-XML Transcriptions. Once uploaded to a TEI-XML folder on a website, it exposes a series of Uniform Resource Identifiers (URI). By using these identifier endpoints, a user can retrieve specific information from a TEI-XML file.
Currently, our prototype only manages one TEI-XML file and only supports URI requests from the same domain as the API itself. To find out about future development plans, please see our about the project" section.
- You will need to have a website capable of running PHP scripts.
- In order for apitext to work, you will need to designate a folder on your website that will hold your TEI-XML file.
- You will need to upload apitext into that folder.
- You can clone or download the apitext repository here.
- Note: If you choose to download the apitext repository from Github:
- You will need extract the base repository folder from the unzipped folder (when zipping files, Github creates a folder inside a folder).
- You will need to remove the
-master
from the end of the base folder's name (when zipping files, Github adds "-master" to the end of the repository name). - You will then need to move the
.htaccess
file outside of theapitext_api
folder. - You will then need to edit the
config.json
file located inside theapitext_api
folder. - In the
teiFolder
entry put the name of your TEI-XML folder. - In the
teiFile
entry put the name of your TEI-XML file. - As an example, if your folder was named
my-tei-folder
and your file was namedmy-tei-xml-file.xml
, then yourconfig.json
file would look like this:
{
"teiFolder": "my-tei-folder",
"teiFile" : "my-tei-xml-file.xml"
}
- That's it, the API should now be controlling your TEI-XML folder. Use a web browser to navigate to your file folder, you should see a welcome message.
Right now, apitext supports the following URI endpoints. To utilize an endpoint, just place it at the end of the URL path of your TEI folder.
api/v1/resources
- Returns a listing of all available endpoints for the API.
api/v1/xml
- Returns the XML view of the TEI-XML file.
api/v1/text
- Returns a text only view of the TEI-XML file.
api/v1/markup
- Returns a markup only (HTML) view of the TEI-XML file.
api/v1/elements
- Returns a listing of all elements contained within the TEI-XML file.
api/v1/elements/[specific element]
- Returns a unique listing of all the textual content contained within the [specific element(s)].
api/v1/annotations
- Returns a listing of all annotation elements contained within the TEI-XML file.
api/v1/teiheaders
- Returns a listing of all teiheader elements contained within the TEI-XML file.