Skip to main content

Documentation Service

The documentation resource contains all the public and private documentation. Generally, public documentation is used for the product whereas private documentation is used for providing operational support documentation to be displayed in the portal dashboards.

Documentation REST API

The Documentation REST API is a full CRUD API allowing you to search and filter documentation as well as update, version and delete them. It is accessed through the following URL:

https://api.opendatadsl.com/api/documentation

The API consists of the following calls:

MethodPathExampleDescription
GETGet the build information for this service
GET{release}/{source}'v1/public' 'v1/private'List public or private documentation
GET{release}/{source}/{key}v1/private/TESTRetrieve a single document using it’s scope code
GET{release}/{source}/{key}/{version}v1/private/TEST/1Retrieve a version of a single document
GET{release}/{source}/{key}/*v1/private/TEST/*Get a list of versions for a specific document
PUT{release}/{source}/{key}/{version}/{tag}v1/private/TEST/1/PRODTag a version with a name (which can be used instead of the version number when retrieving it)
POST{release}v1Create or update a document, the documentation is the body of the POST request
DELETE{release}/{source}/{key}v1/private/TESTRollback to the previous version of a document, if it is the only version then the document will be deleted
DELETE{release}/{source}/{key}/{version}v1/private/TEST/1Delete a specific version of a document
DELETE{release}/{source}/{key}/*v1/private/TEST/*Fully delete a document, including all versions

Entities

Documentation Entity

The documentation entity contains the following information:

NameDescriptionType
_idUnique id as an object idString
_typeThe type of the entity - always VarDocumentationString
nameThe name of the documentation (optional)String
scopeThe scope, usually the service nameString
entityThe entity within the scope (optional)String
languageThe ISO 639-1 language code e.g. en for EnglishString
contentThe markdown content of the documentationString
tagsA list of tagsList(String)
_oidThe id of the documentation - will match _id if this is the latest version of the documentationString
_timestampTimestamp of when this documentation version was createdString(DateTime)
_userThe user id (email) of the user that created this documentation verisionString
_tagA list of version tag names for this documentation versionString[]
_versionThe version number of this documentation versionint

Example REST Calls

info

The documentation service uniquely allows you to use either the _id (ObjectId) fields to retrieve documentation or the scope[:entity]

Getting documentation using scope

GET https://api.opendatadsl.com/api/documentation/v1/public/report:reportType
Authorization: Bearer {{token}}

Getting documentation using id

GET https://api.opendatadsl.com/api/documentation/v1/private/6605507f88334254f7bb86f3
Authorization: Bearer {{token}}

Getting documentation content in HTML

GET https://api.opendatadsl.com/api/documentation/v1/public/report:reportType
Authorization: Bearer {{token}}
Accept: text/html

Add some private documentation

POST https://api.opendatadsl.com/api/documentation
Authorization: Bearer {{token}}

{
"_id": "CME_CL_FUT",
"_type": "VarDocumentation",
"name": "CME CL Futures",
"scope": "CME_CL_FUT",
"content":"## Test\n### CME Data"
}

List the public documentation

GET https://api.opendatadsl.com/api/documentation/v1/public
?_project={scope:1,entity:1}
Authorization: Bearer {{token}}

List the distinct public documentation

GET https://api.opendatadsl.com/api/documentation/v1/public
?_aggregate=[{$group:{_id:{scope:"$scope",entity:"$entity"}}},{$project:{_id:0,scope:"$_id.scope",entity:"$_id.entity"}}]
Authorization: Bearer {{token}}

Language

Getting documentation content in German

GET https://api.opendatadsl.com/api/documentation/v1/public/report:reportType
Authorization: Bearer {{token}}
Accept: text/html
Accept-Language: de,en-US;q=0.7,en;q=0.3

Getting documentation content in Italian, but fall back to Spanish

GET https://api.opendatadsl.com/api/documentation/v1/public/report:reportType
Authorization: Bearer {{token}}
Accept: text/html
Accept-Language: it,es;q=0.7,en;q=0.3