Create a Comment

POST /comments/{resource_type}/{resource_id}

Creates a comment for the given Resource.

Path parameters

  • resource_type string Required

    The kind of Resource that a Comment belongs to. Should be one of [elasticsearch, kibana, apm, appsearch, enterprise_search, integrations_server, allocator, constructor, runner, proxy].

  • resource_id string Required

    Id of the Resource that a Comment belongs to.

Body Required

Data for comment creation

  • message string Required

    The message for the Comment.

Responses

  • The Comment that was just created.

    Hide headers attributes Show headers attributes
    Hide response attributes Show response attributes object
    • id string Required

      The id of this Comment

    • user_id string Required

      The user id of the user who wrote this Comment

    • message string Required

      The message content of this Comment

  • Your current session does not have a user id associated with it. (code: comments.no_user_id)

    Hide headers attribute Show headers attribute
    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

  • No Resource of the given type and id exist. (code: comments.resource_does_not_exist)

    Hide headers attribute Show headers attribute
    • The error codes associated with the response

      Value is comments.resource_does_not_exist.

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

  • A Comment already exists with the generated id. Please try again. (code: comments.id_already_exists)

    Hide headers attribute Show headers attribute
    • The error codes associated with the response

      Value is comments.id_already_exists.

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

POST /comments/{resource_type}/{resource_id}
curl \
 -X POST https://{{hostname}}/api/v1/comments/{resource_type}/{resource_id} \
 -d '{"message":"string"}'
Request examples
{
  "message": "string"
}
Response examples (201)
# Headers
x-cloud-resource-version: string
x-cloud-resource-created: string
x-cloud-resource-last-modified: string

# Payload
{
  "id": "string",
  "user_id": "string",
  "message": "string"
}
Response examples (401)
# Headers
x-cloud-error-codes: comments.no_user_id

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
Response examples (404)
# Headers
x-cloud-error-codes: comments.resource_does_not_exist

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
Response examples (409)
# Headers
x-cloud-error-codes: comments.id_already_exists

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}