The currently the only API is /api/convert e.g. http://localhost:8075/api/convert.
It supports three modes of use.
A GET request will show a very simple submission form that allows the user to select a file which will be submitted to the API.
The PDF can be posted as data to the API. The API will respond with the JATS XML.
e.g.
curl -X POST --show-error -H "Content-Type: application/pdf" \
--data-binary @test.pdf \
http://localhost:8075/api/convert?filename=test.pdf
The filename parameter is optional.
The PDF can also be posted as a file. The effect will be the same as posting it as data.
e.g.
curl -X POST --show-error --form \
"file=@test.pdf;filename=test.pdf" \
http://localhost:8075/api/convert
Add the includes URL parameter. Currently the valid values are:
- title
- abstract
- authors
- affiliations
- references
- full-text
curl -X POST --show-error -H "Content-Type: application/pdf" \
--data-binary @test.pdf \
'http://localhost:8075/api/convert?filename=test.pdf&includes=title,abstract,authors,affiliations'
Note: This currently does not filter the response but is considered when deciding whether to perform more expensive operations (e.g. references and full-text will be more expensive).
The API currently supports the following file types:
- .pdf (application/pdf)
- .doc (application/msword)
- .docx (application/vnd.openxmlformats-officedocument.wordprocessingml.document)
- .dotx (application/vnd.openxmlformats-officedocument.wordprocessingml.template)
- .rtf (application/rtf)
The content type is inferred from the filename if the content is submitted with the content type application/octet-stream.