Movatterモバイル変換


[0]ホーム

URL:


HashiConf 2025Don't miss the live stream of HashiConf Day 2 happening now View live stream

You are viewing documentation for version v202409-3.View latest version.

Comments allow users to leave feedback or record decisions about a run.

List Comments for a Run

GET /runs/:id/comments

ParameterDescription
idThe ID of the run.

Sample Request

$ curl \  --header "Authorization: Bearer $TOKEN" \  --header "Content-Type: application/vnd.api+json" \  https://app.terraform.io/api/v2/runs/run-KTuq99JSzgmDSvYj/comments

Sample Reponse

{  "data": [    {      "id": "wsc-JdFX3u8o114F4CWf",      "type": "comments",      "attributes": {        "body": "A comment body"      },      "relationships": {        "run-event": {          "data": {            "id": "re-fo1YXZ8W5bp5GBKM",            "type": "run-events"          },          "links": {            "related": "/api/v2/run-events/re-fo1YXZ8W5bp5GBKM"          }        }      },      "links": {        "self": "/api/v2/comments/wsc-JdFX3u8o114F4CWf"      }    },    {      "id": "wsc-QdhSPFTNoCTpfafp",      "type": "comments",      "attributes": {        "body": "Another comment body"      },      "relationships": {        "run-event": {          "data": {            "id": "re-fo1YXZ8W5bp5GBKM",            "type": "run-events"          },          "links": {            "related": "/api/v2/run-events/re-fo1YXZ8W5bp5GBKM"          }        }      },      "links": {        "self": "/api/v2/comments/wsc-QdhSPFTNoCTpfafp"      }    }  ]}

Show a Comment

GET /comments/:id

ParameterDescription
idThe ID of the comment.

Sample Request

$ curl \  --header "Authorization: Bearer $TOKEN" \  --header "Content-Type: application/vnd.api+json" \  https://app.terraform.io/api/v2/comments/wsc-gTFq83JSzjmAvYj

Sample Response

{  "data": {    "id": "wsc-gTFq83JSzjmAvYj",    "type": "comments",    "attributes": {      "body": "Another comment"    },    "relationships": {      "run-event": {        "data": {            "id": "re-8RB5ZaFrDanG2hGY",            "type": "run-events"        },        "links": {            "related": "/api/v2/run-events/re-8RB5ZaFrDanG2hGY"        }      }    },    "links": {      "self": "/api/v2/comments/wsc-gTFq83JSzjmAvYj"    }  }}

Create Comment

POST /runs/:id/comments

ParameterDescription
idThe ID of the run.

Request Body

This POST endpoint requires a JSON object with the following properties as the request payload.

Key PathTypeDefaultDescription
data.typestringMust be"comments".
data.attributes.bodystringThe body of the comment.

Sample Payload

{  "data": {    "attributes": {      "body": "A comment about the run",    },    "type": "comments"  }}

Sample Request

$ curl \  --header "Authorization: Bearer $TOKEN" \  --header "Content-Type: application/vnd.api+json" \  --request POST \  --data @payload.json \  https://app.terraform.io/api/v2/runs/run-KTuq99JSzgmDSvYj/comments

Sample Response

{  "data": {    "id": "wsc-oRiShushpgLU4JD2",    "type": "comments",    "attributes": {      "body": "A comment about the run"    },    "relationships": {      "run-event": {          "data": {            "id": "re-E3xsBX11F1fbm2zV",            "type": "run-events"          },          "links": {            "related": "/api/v2/run-events/re-E3xsBX11F1fbm2zV"          }      }    },    "links": {      "self": "/api/v2/comments/wsc-oRiShushpgLU4JD2"    }  }}
Edit this page on GitHub

[8]ページ先頭

©2009-2025 Movatter.jp