Kungl. Biblioteket Eplikt APIS
Introduction
APIs related to eplikt deliveries are found at api.eplikt.kb.se.
Currently available APIs are:
- Validation of XML schemas
Validation service
tl;dr
Example with curl:
curl --header "Content-Type:text/xml" --data-binary @myrss.xml "http://api.eplikt.kb.se/validate?schema=WEB_ARTICLE_RSS"
Usage
Validation service is available at:
http://api.eplikt.kb.se/validate?schema=SCHEMA_NAME
Available schemas are:
Response
If the XML validates according to schema the response will be:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<validationResponse>
<resultcode>OK</resultcode>
</validationResponse>
If the XML does not validate, a message will be returned including relevant validations errors as well as line number and column:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<validationResponse>
<resultcode>ERROR</resultcode>
<schemaValidationErrors>
<error>
<message>cvc-complex-type.2.4.b: The content of element 'item' is not complete. One of '{pubDate, category, enclosure, comments, "http://purl.org/dc/terms/":license, "http://purl.org/dc/terms/":creator, "http://purl.org/dc/terms/":contributor, "http://search.yahoo.com/mrss/":content, "http://search.yahoo.com/mrss/":keywords, "http://search.yahoo.com/mrss/":credit, "http://search.yahoo.com/mrss/":category, "http://purl.org/rss/1.0/modules/content/":encoded, "http://purl.org/dc/terms/":date, "http://purl.org/dc/terms/":type, "http://purl.org/dc/terms/":identifier, "http://purl.org/dc/terms/":source, "http://purl.org/dc/terms/":language, "http://purl.org/dc/terms/":relation, "http://purl.org/dc/terms/":coverage, "http://purl.org/dc/terms/":rights, "http://purl.org/dc/terms/":alternative, "http://purl.org/dc/terms/":tableOfContents, "http://purl.org/dc/terms/":abstract, "http://purl.org/dc/terms/":created, "http://purl.org/dc/terms/":valid, "http://purl.org/dc/terms/":available, "http://purl.org/dc/terms/":issued, "http://purl.org/dc/terms/":modified, "http://purl.org/dc/terms/":dateAccepted, "http://purl.org/dc/terms/":dateCopyrighted, "http://purl.org/dc/terms/":dateSubmitted, "http://purl.org/dc/terms/":extent, "http://purl.org/dc/terms/":medium, "http://purl.org/dc/terms/":isVersionOf, "http://purl.org/dc/terms/":hasVersion, "http://purl.org/dc/terms/":isReplacedBy, "http://purl.org/dc/terms/":replaces, "http://purl.org/dc/terms/":isRequiredBy, "http://purl.org/dc/terms/":requires, "http://purl.org/dc/terms/":isPartOf, "http://purl.org/dc/terms/":hasPart, "http://purl.org/dc/terms/":isReferencedBy, "http://purl.org/dc/terms/":references, "http://purl.org/dc/terms/":isFormatOf, "http://purl.org/dc/terms/":hasFormat, "http://purl.org/dc/terms/":conformsTo, "http://purl.org/dc/terms/":spatial, "http://purl.org/dc/terms/":temporal, "http://purl.org/dc/terms/":audience, "http://purl.org/dc/terms/":accrualMethod, "http://purl.org/dc/terms/":accrualPeriodicity, "http://purl.org/dc/terms/":accrualPolicy, "http://purl.org/dc/terms/":instructionalMethod, "http://purl.org/dc/terms/":provenance, "http://purl.org/dc/terms/":rightsHolder, "http://purl.org/dc/terms/":mediator, "http://purl.org/dc/terms/":educationLevel, "http://purl.org/dc/terms/":bibliographicCitation, "http://search.yahoo.com/mrss/":group}' is expected. -- Line 22 and column 12</message>
<location>Line 22 and column 12</location>
</error>
<error>
<message>cvc-complex-type.2.4.b: The content of element 'item' is not complete. One of '{pubDate, category, enclosure, comments, "http://purl.org/dc/terms/":license, "http://purl.org/dc/terms/":creator, "http://purl.org/dc/terms/":contributor, "http://search.yahoo.com/mrss/":content, "http://search.yahoo.com/mrss/":keywords, "http://search.yahoo.com/mrss/":credit, "http://search.yahoo.com/mrss/":category, "http://purl.org/rss/1.0/modules/content/":encoded, "http://purl.org/dc/terms/":date, "http://purl.org/dc/terms/":type, "http://purl.org/dc/terms/":identifier, "http://purl.org/dc/terms/":source, "http://purl.org/dc/terms/":language, "http://purl.org/dc/terms/":relation, "http://purl.org/dc/terms/":coverage, "http://purl.org/dc/terms/":rights, "http://purl.org/dc/terms/":alternative, "http://purl.org/dc/terms/":tableOfContents, "http://purl.org/dc/terms/":abstract, "http://purl.org/dc/terms/":created, "http://purl.org/dc/terms/":valid, "http://purl.org/dc/terms/":available, "http://purl.org/dc/terms/":issued, "http://purl.org/dc/terms/":modified, "http://purl.org/dc/terms/":dateAccepted, "http://purl.org/dc/terms/":dateCopyrighted, "http://purl.org/dc/terms/":dateSubmitted, "http://purl.org/dc/terms/":extent, "http://purl.org/dc/terms/":medium, "http://purl.org/dc/terms/":isVersionOf, "http://purl.org/dc/terms/":hasVersion, "http://purl.org/dc/terms/":isReplacedBy, "http://purl.org/dc/terms/":replaces, "http://purl.org/dc/terms/":isRequiredBy, "http://purl.org/dc/terms/":requires, "http://purl.org/dc/terms/":isPartOf, "http://purl.org/dc/terms/":hasPart, "http://purl.org/dc/terms/":isReferencedBy, "http://purl.org/dc/terms/":references, "http://purl.org/dc/terms/":isFormatOf, "http://purl.org/dc/terms/":hasFormat, "http://purl.org/dc/terms/":conformsTo, "http://purl.org/dc/terms/":spatial, "http://purl.org/dc/terms/":temporal, "http://purl.org/dc/terms/":audience, "http://purl.org/dc/terms/":accrualMethod, "http://purl.org/dc/terms/":accrualPeriodicity, "http://purl.org/dc/terms/":accrualPolicy, "http://purl.org/dc/terms/":instructionalMethod, "http://purl.org/dc/terms/":provenance, "http://purl.org/dc/terms/":rightsHolder, "http://purl.org/dc/terms/":mediator, "http://purl.org/dc/terms/":educationLevel, "http://purl.org/dc/terms/":bibliographicCitation, "http://search.yahoo.com/mrss/":group}' is expected. -- Line 34 and column 12</message>
<location>Line 34 and column 12</location>
</error>
</schemaValidationErrors>
</validationResponse>
Caveats
Currently the order of pubDates is not validated which can lead to a situation where an OK and be returned from the service but the feed will not work once it is registered with us.
Ensure that pubDates are in descending order as specified in the specification.