REST API

The REST API is available at https://saas.deltaxml.com/api/content-compare/v1/JATS

Content Compare JATS is a very simple REST API with two endpoints: /compare and /authorise.

Endpoint

Method

Description

Documentation

/compare

POST

comparison of two XML files

POST /compare

/authorise

GET

refresh access token

GET /authorise

POST /compare

Comparisons are posted using multipart/form-data to

https://saas.deltaxml.com/api/content-compare/JATS/v1/compare
CODE

Parameter

Description

inputA

REQUIRED

Input A to the comparison. We only display the changes in content from this version.

See information below on how to send input files.

inputB

REQUIRED

Input B to the comparison. We retain the structure of this input in the result file.

See information below on how to send input files.

outputType

Use oxygen-tc (default) to get output using Oxygen processing instructions, or html to get a HTML result.

Authorisation

To make a comparison you will need to set the Authorization header to use your id as a Bearer token, for example:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
CODE

How to Send Input Files

Files can be sent in two ways: URLs, or as raw XML.

URL inputs
For secure URLs set the Content-Type of the inputA/inputB to text/plain .
Here is an example:

...
----form-boundary-id
Content-Disposition: form-data; name="inputA"
Content-Type: text/plain

https://www.example.com/JATS/inputA.xml
----form-boundary-id
...
CODE

Raw XML inputs
To send raw XML you can send either a raw XML string, or attach an XML file.

Set the Content-Type of the inputA/inputB part to application/xml or text/xml.
Here is an example:

...
----form-boundary-id
Content-Disposition: form-data; name="inputA"
Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8"?>
<content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.JATS.org/JATS_5-0/xml_schema_flat/descript.xsd">
   <description>
      <levelledPara>...etc...
----form-boundary-id
...
CODE

Responses

200 Successful comparison returns the comparison result.

HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.1d1 20130915//EN" "JATS-journalpublishing1.dtd">
<article article-type="research-article" dtd-version="1.1d1" xml:lang="en">
    <body>
        <p>First JATS paragraph. </p>
        <p>Second 
            <?oxy_delete author="deltaxml" timestamp="20220613T160842+0100" content="Merged "?>JATS paragraph 
            <boxed-text>
                <sec>
                    <title>Summary points</title>
                    <p>
                        <list list-type="bullet">
                            <list-item>
                                <p>Longer consultations are associated with a range of better patient outcomes</p>
                            </list-item>
                            <list-item>
                                <p>Research on implementation is needed</p>
                            </list-item>
                        </list>
                    </p>
                </sec>
            </boxed-text>
        </p>
    </body>
</article>
CODE

GET /authorise

Get updated token information by using your refresh, id, and expiry information you downloaded earlier by passing them as query parameters to /authorise, for example:

GET https://saas.deltaxml.com/api/content-compare/v1/JATS/authorise?refresh=ABCDEF123&expiry=1648141119&id=id
CODE

The response will be in the same JSON format you received when you requested your token.

Errors

400 Bad Request. Check the error message for details of what may need to be changed when you re-attempt the comparison. If you continue to receive an error, please contact support using our Customer Support Portal and report the error details.

500 Server Error. If you encounter these, please contact support using our Customer Support Portal and report the error details.

Errors will be reported with a parent element of <error> containing these child elements:

  • <errorMessage> - description of the error

  • <errorId> - unique ID to track errors

  • <errorCode> - the HTTP Response code

  • <timestamp> - ISO 8601 timestamp

An example of an error:

<error>
    <errorMessage>Parameter output-type value is invalid. Please choose from oxygen-tc or JATS(default)</errorMessage>
    <errorId>8d395670-2e56-490d-9c3b-f87ee0154f81</errorId>
    <errorCode>400</errorCode>
    <timestamp>2022-03-24T14:19:29.516+0000</timestamp>
</error>
CODE

Restrictions

Only JATS content can be compared. Files will be rejected by the API if they do not conform and you will receive an error.

If you’re getting an error message blocking your JATS content from being compared, please contact DeltaXML.

Usage Limit

Trial users get 100 comparisons / month.

Paid subscribers get 1000 comparisons / month. To request more, please contact DeltaXML.

To see your current usage, go to Subscription Manager in MyDelta and find the relevant deal. Under the “Quantity” column will be information on your current usage level.

Input Size Limit

There is an input size limit of 5 Mb for each input file for trial users.

Ready to Subscribe?

If you’re ready to subscribe to Content Compare JATS, please contact DeltaXML.