Download the PHP package thomas-institut/apm-publication-api without Composer
On this page you can find all versions of the php package thomas-institut/apm-publication-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thomas-institut/apm-publication-api
More information about thomas-institut/apm-publication-api
Files in thomas-institut/apm-publication-api
Package apm-publication-api
Short Description Definition and client for APM's publication API
License GPL-3.0-or-later
Informations about the package apm-publication-api
APM Publication API
This repo provides the official definition of APM's publication API in PHP and a client implementation.
This repo is still alpha. DO NOT assume any information or code here will stay as it is right now.
API Description
The Publication API is how APM publishes its data to external clients, most notably APE. APM users determine which resources they want to make available to specific clients, and the clients call the API to get a listing of these resources and to get the data.
There are two calls:
api/publication/list: returns a StandardApiResponse with an array of PublicationListing objectsapi/publication/{id}/get: returns a StandardApiResponse with the data for the given id.
A publication listing consists of general information about a publication:
- type: for example,
'Transcription' - id
- versionTimeString
- title
- description
The data for a publication contains this same information together with all required resource's data according to the publication type.
Publication Types
Text
A text string without any formatting.
Transcription
The transcription of a document, normally a manuscript. It consists of an array of pages, each one with a number of columns, with each column containing a transcription. A column transcription consists of an array of elements (main text, marginal additions, etc.). Each element in turn consists of an array of transcription items: simple text, abbreviations, additions, etc.
Edition
TBD
Api Client
The PublicationApiClient requires a PSR-18 HTTP Client and a PSR-17 Request Factory. Below is an example of how to use it with Guzzle.
Installation
If you don't have an HTTP client yet, you can install Guzzle:
Usage Example
Key Components
GuzzleHttp\Client: ImplementsPsr\Http\Client\ClientInterface.GuzzleHttp\Psr7\HttpFactory: ImplementsPsr\Http\Message\RequestFactoryInterface.baseUrl: The base URL for the APM API (e.g.,https://example.com/api). The client automatically appends/publication/listor/publication/{id}/getto this URL.logger: (Optional) APsr\Log\LoggerInterfaceto log API requests and responses. Defaults toNullLogger.debug: (Optional) Set totrueto enable detailed debug logging. Defaults tofalse.
All versions of apm-publication-api with dependencies
thomas-institut/standard-api Version 1.0.0
psr/log Version ^3.0.2
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
cuyz/valinor Version ^2.4