コンテンツにスキップ

仕様書の目次(アウトライン)取得

GET
/spec/{document_type}
curl --request GET \
--url 'https://api.plateauview.mlit.go.jp/spec/standard?depth=2&format=json'

指定した文書の章・節の階層構造とパスを取得します。得られたパスは /spec/{document_type}/{path} に渡して本文取得に使用します。

document_type
required
string
Allowed values: standard procedure

対象文書。standard(標準製品仕様書) / procedure(標準作業手順書)

depth
integer
default: 2 >= 1 <= 4

取得する階層の深さ。1=章のみ、2=章+節。既定: 2、最大: 4

chapter
string

特定の章のみ取得する場合に指定。例: toc4

format
string
default: json
Allowed values: json markdown

出力形式。既定: json

成功時のレスポンス。format=json は目次項目の配列、format=markdown は Markdown テキスト。

Array<object>

仕様書の目次項目(再帰的)

object
id
string
title
string
path

/spec/read で本文取得に使うパス

string
children
Array<object> recursive
Example generated
[
{
"id": "example",
"title": "example",
"path": "example",
"children": [
{}
]
}
]

文書種別が不正

Media type application/json
object
error
required

エラーメッセージ

string
url

エラーが発生したURL

string
reason

エラーの原因

string
Example generated
{
"error": "example",
"url": "example",
"reason": "example"
}

目次の取得に失敗

Media type application/json
object
error
required

エラーメッセージ

string
url

エラーが発生したURL

string
reason

エラーの原因

string
Example generated
{
"error": "example",
"url": "example",
"reason": "example"
}