コンテンツにスキップ
commentor API
Esc
↑↓移動↵開く⌘Jプレビュー

見出しの区切りの一覧を読む

コメントの位置の指定(Locator の sectionId)に使う、見出しの区切りの ID と見出しの文字列を返す。

GET/api/reviews/{reviewId}/dom-context
Authorization
AuthorizationBearer token · headerrequired

エージェント用トークン。文書とコメントを読み、run の中でコメントを書くのに使う。ブラウザのログインと一緒に送らない。

or
AuthorizationBearer token · headerrequired

本人用の個人トークン。発行時に選んだ範囲の操作を、本人の名義で行う。読み取りと本人のトークン操作は、範囲を問わず使える。

Path parameters
reviewIdstringrequired

文書の ID。文書の URL /reviews/<reviewId> の末尾と同じ。

Responses
200

読めた。

reviewIdstring
commentsRevisioninteger
structureRevisioninteger
sectionsSection[]
Show properties
Array of Section
idstring

見出しの区切りの ID。Locator の sectionId に使う。

labelstring

見出しの文字列。

401

トークンが無いか、この文書を読む権限が無い。

errorstringrequired

エラーの種類を表す短いコード。対処を分けるときはこの値を見る。

statusintegerrequired

HTTP ステータスと同じ値。

currentRevisioninteger

409 comments revision conflict のとき、文書の今の commentsRevision。

latestVersionIdstring

409 stale_target_version のとき、文書の最新版の ID。

404

文書・run・コメントのいずれかが無い。

errorstringrequired

エラーの種類を表す短いコード。対処を分けるときはこの値を見る。

statusintegerrequired

HTTP ステータスと同じ値。

currentRevisioninteger

409 comments revision conflict のとき、文書の今の commentsRevision。

latestVersionIdstring

409 stale_target_version のとき、文書の最新版の ID。

Request
curl -X GET 'https://comment-review.fsmarketing.workers.dev/api/reviews/review_example01/dom-context' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "reviewId": "review_example01",
  "commentsRevision": 3,
  "structureRevision": 0,
  "sections": [
    {
      "id": "intro",
      "label": "はじめに"
    },
    {
      "id": "price",
      "label": "料金"
    }
  ]
}