The API documentation page is automatically generated by sapi-nt, based on the application’s configured endpoints and documentation configuration.
Code examples in the documentation are rendered with syntax highlighting provided by highlight.js.
The API documentation page is comprised by the following sections:
It uses the following common style classes:
| Class | Usage |
|---|---|
| api-doc | The main body of the API documentation page. |
| doc-content | An element which contains a HTML fragment supplied by the documentation configuration. |
| example | An example URL which illustrates the usage of an API endpoint. |
| anchor | A marker class which denotes that an element should be linked in the side bar for quick access. |
The side bar is automatically generated using Javascript that is embedded in the page, and displays links to each of the main sections of the page and some sub-sections.
It uses the following style classes:
| Class | Usage |
|---|---|
| sidebar | The side bar container. |
The introduction section contains an introductory narrative that is supplied by the documentation configuration. As such most of the markup, including style classes, will be determined by the author.
The introduction section uses the following style classes:
| Class | Usage |
|---|---|
| api-doc-intro | The introduction section. |
| doc-content | The HTML fragment supplied by the configuration. |
The API structure section contains general information about the standard features and usage of sapi-nt APIs. It displays tables of the available content types and standard filter prefixes that can be used to filter results by a range of values.
The API structure section uses the following style classes:
| Class | Usage |
|---|---|
| api-doc-stucture | The API structure section. |
The content type table has two columns. The left column displays the file extension for each content type served by the API, and the right column displays the corresponding MIME type.
The content type table uses the following style classes:
| Class | Usage |
|---|---|
| content-type-table | The table of content types that are available from the API. |
| content-type-ext | The file extension column. |
| content-type-mime | The MIME type column. |
The filter prefix table has two columns. The left column displays the prefixes that can be applied to filter parameters. The right column displays a brief description of the prefix.
| Class | Usage |
|---|---|
| filter-prefix-table | The table of prefixes that can be applied to filter parameters. |
| filter-prefix | The filter prefix column. |
| comment | A description of the filter prefix. |
The API summary section displays an overview of the endpoints exposed by the API, and groups together endpoints with similar functionality (this is determined by the documentation configuration). It displays a table of endpoints for each group.
It uses the following style classes:
| Class | Usage |
|---|---|
| api-doc-summary | The API summary section. |
| summary-group | The container for a grouping of endpoints with similar functionality. |
| doc-content | The HTML fragment, supplied by the configuration, that describes a group of endpoints. |
The table of endpoints has columns for the description, URL and query parameters of each endpoint. These columns can be excluded or reordered depending on the documentation configuration.
It uses the following style classes:
| Class | Usage |
|---|---|
| comment | The endpoint description column. |
| endpoint-target | The endpoint URL column. |
| endpoint-params | The endpoint parameters column. |
| path-param | A path parameter. |
| required-param | A required parameter. |
| documented-param | A parameter that was highlighted for documentation in the configuration. |
| standard-param | A parameter which is supported by standard sapi-nt functionality. |
| view-param | The parameter which controls the user’s choice of view. |
| search-param | The parameter which controls the text search filter. |
| geo-fetch-param | The parameter which determines whether to return geometry data. |
| geo-filter-param | The parameters which control geographical filters. |
The API detail section contains more detailed information about the API endpoints, and groups together endpoints which return data about the same types of resources, known as classes (this is determined by the documentation configuration). The returned data section for each endpoint can be toggled by clicking on the “Show” and “Hide” links.
The API detail section uses the following style classes:
| Class | Usage |
|---|---|
| api-doc-detail | The API detail section. |
| class-examples | A container for the set of examples for each class. |
| returned-data | A container for information about the structure of data returned by the API endpoints. |
| returned-data-toggle | A container for the returned data section toggle link. |
| returned-data-show | A link which shows the returned data section for an endpoint. |
| returned-data-hide | A link which hides the returned data section for an endpoint. |
The table of properties illustrates the properties that are expected to be included in the data returned by an endpoint, as well as the properties (and property paths) for which a user may apply filters or projections. It has columns for the type, cardinality, and description of each property path. It also has a column which displays a list of a views in which the property path is available for retrieval and filtering.
It uses the following style classes:
| Class | Usage |
|---|---|
| property-table | The property table. |
| property-path | The property path column. |
| property-type | The property type column. |
| property-cardinality | The property cardinality column. |
| property-views | The property views column. |
| property-description | The property description column. |
| placeholder | The placeholder text in the description column. |
The prefix mapping section contains a table of the namespace prefix mappings that are configured in the API’s data model. These are represented as a table.
The prefix mapping section uses the following style classes:
| Class | Usage |
|---|---|
| api-doc-prefixes | The prefix mapping section. |
The prefix table has two columns. The left column displays the compact form of each prefix, and the right column displays the full URI. It shares some style classes with the similar table which is rendered in the data model documentation.
The prefix table uses the following style clases:
| Class | Usage |
|---|---|
| prefix-table | The table of namespace prefixes and their respective URIs. |
| prefix-map-prefix | The prefix column. |
| prefix-map-uri | The URI column. |
| default-prefix | The default, or empty prefix. |
The data reference section contains definitions for terms which are referenced in the documentation or the API results, such as RDF properties and concept schemes. This is based on a vocabulary file that is supplied by the documentation configuration.
The data reference section uses the following style classes:
| Class | Usage |
|---|---|
| api-doc-data-reference | The data reference section. |
| vocab-index | An index which links to the individual terms in the vocabulary. |
| vocab | The container for the vocabulary terms and definitions. |
| vocab-statement | A statement about a particular term. |
| vocab-term | A term that is defined in the vocabulary. |
| vocab-definition | The definition of the term. |