Inserts a new resource into this collection.

Scopes

You will need authorization for at least one of the following scopes to make a valid call:

  • https://www.googleapis.com/auth/youtube
  • https://www.googleapis.com/auth/youtube.force-ssl

If unset, the scope for this method defaults to https://www.googleapis.com/auth/youtube. You can set the scope for this method like this: youtube3 --scope <scope> live-chat-messages insert ...

Required Request Value

The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.

For example, a structure like this:

LiveChatMessage:
  author-details:
    channel-id: string
    channel-url: string
    display-name: string
    is-chat-moderator: boolean
    is-chat-owner: boolean
    is-chat-sponsor: boolean
    is-verified: boolean
    profile-image-url: string
  etag: string
  id: string
  kind: string
  snippet:
    author-channel-id: string
    display-message: string
    fan-funding-event-details:
      amount-display-string: string
      amount-micros: string
      currency: string
      user-comment: string
    gift-membership-received-details:
      associated-membership-gifting-message-id: string
      gifter-channel-id: string
      member-level-name: string
    has-display-content: boolean
    live-chat-id: string
    member-milestone-chat-details:
      member-level-name: string
      member-month: integer
      user-comment: string
    membership-gifting-details:
      gift-memberships-count: integer
      gift-memberships-level-name: string
    message-deleted-details:
      deleted-message-id: string
    message-retracted-details:
      retracted-message-id: string
    new-sponsor-details:
      is-upgrade: boolean
      member-level-name: string
    poll-details:
      metadata:
        question-text: string
      status: string
    published-at: string
    super-chat-details:
      amount-display-string: string
      amount-micros: string
      currency: string
      tier: integer
      user-comment: string
    super-sticker-details:
      amount-display-string: string
      amount-micros: string
      currency: string
      super-sticker-metadata:
        alt-text: string
        alt-text-language: string
        sticker-id: string
      tier: integer
    text-message-details:
      message-text: string
    type: string
    user-banned-details:
      ban-duration-seconds: string
      ban-type: string
      banned-user-details:
        channel-id: string
        channel-url: string
        display-name: string
        profile-image-url: string

can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.

  • -r .author-details channel-id=et
    • The YouTube channel ID.
  • channel-url=nonumy
    • The channel's URL.
  • display-name=accusam
    • The channel's display name.
  • is-chat-moderator=false
    • Whether the author is a moderator of the live chat.
  • is-chat-owner=true
    • Whether the author is the owner of the live chat.
  • is-chat-sponsor=false
    • Whether the author is a sponsor of the live chat.
  • is-verified=true
    • Whether the author's identity has been verified by YouTube.
  • profile-image-url=et

    • The channels's avatar URL.
  • .. etag=aliquyam

    • Etag of this resource.
  • id=ipsum
    • The ID that YouTube assigns to uniquely identify the message.
  • kind=gubergren
    • Identifies what kind of resource this is. Value: the fixed string "youtube#liveChatMessage".
  • snippet author-channel-id=invidunt
    • The ID of the user that authored this message, this field is not always filled. textMessageEvent - the user that wrote the message fanFundingEvent - the user that funded the broadcast newSponsorEvent - the user that just became a sponsor memberMilestoneChatEvent - the member that sent the message membershipGiftingEvent - the user that made the purchase giftMembershipReceivedEvent - the user that received the gift membership messageDeletedEvent - the moderator that took the action messageRetractedEvent - the author that retracted their message userBannedEvent - the moderator that took the action superChatEvent - the user that made the purchase superStickerEvent - the user that made the purchase pollEvent - the user that created the poll
  • display-message=sea
    • Contains a string that can be displayed to the user. If this field is not present the message is silent, at the moment only messages of type TOMBSTONE and CHAT_ENDED_EVENT are silent.
  • fan-funding-event-details amount-display-string=duo
    • A rendered string that displays the fund amount and currency to the user.
  • amount-micros=sea
    • The amount of the fund.
  • currency=stet
    • The currency in which the fund was made.
  • user-comment=sadipscing

    • The comment added by the user to this fan funding event.
  • ..gift-membership-received-details associated-membership-gifting-message-id=no

    • The ID of the membership gifting message that is related to this gift membership. This ID will always refer to a message whose type is 'membershipGiftingEvent'.
  • gifter-channel-id=tempor
    • The ID of the user that made the membership gifting purchase. This matches the snippet.authorChannelId of the associated membership gifting message.
  • member-level-name=ipsum

    • The name of the Level at which the viewer is a member. This matches the snippet.membershipGiftingDetails.giftMembershipsLevelName of the associated membership gifting message. The Level names are defined by the YouTube channel offering the Membership. In some situations this field isn't filled.
  • .. has-display-content=true

    • Whether the message has display content that should be displayed to users.
  • live-chat-id=sit
    • No description provided.
  • member-milestone-chat-details member-level-name=amet.
    • The name of the Level at which the viever is a member. The Level names are defined by the YouTube channel offering the Membership. In some situations this field isn't filled.
  • member-month=46
    • The total amount of months (rounded up) the viewer has been a member that granted them this Member Milestone Chat. This is the same number of months as is being displayed to YouTube users.
  • user-comment=at

    • The comment added by the member to this Member Milestone Chat. This field is empty for messages without a comment from the member.
  • ..membership-gifting-details gift-memberships-count=75

    • The number of gift memberships purchased by the user.
  • gift-memberships-level-name=takimata

    • The name of the level of the gift memberships purchased by the user. The Level names are defined by the YouTube channel offering the Membership. In some situations this field isn't filled.
  • ..message-deleted-details deleted-message-id=gubergren

    • No description provided.
  • ..message-retracted-details retracted-message-id=et

    • No description provided.
  • ..new-sponsor-details is-upgrade=false

    • If the viewer just had upgraded from a lower level. For viewers that were not members at the time of purchase, this field is false.
  • member-level-name=magna

    • The name of the Level that the viewer just had joined. The Level names are defined by the YouTube channel offering the Membership. In some situations this field isn't filled.
  • ..poll-details.metadata question-text=sit

    • No description provided.
  • .. status=gubergren

    • No description provided.
  • .. published-at=elitr

    • The date and time when the message was orignally published.
  • super-chat-details amount-display-string=ipsum
    • A rendered string that displays the fund amount and currency to the user.
  • amount-micros=kasd
    • The amount purchased by the user, in micros (1,750,000 micros = 1.75).
  • currency=dolore
    • The currency in which the purchase was made.
  • tier=50
    • The tier in which the amount belongs. Lower amounts belong to lower tiers. The lowest tier is 1.
  • user-comment=amet

    • The comment added by the user to this Super Chat event.
  • ..super-sticker-details amount-display-string=ipsum

    • A rendered string that displays the fund amount and currency to the user.
  • amount-micros=lorem
    • The amount purchased by the user, in micros (1,750,000 micros = 1.75).
  • currency=dolores
    • The currency in which the purchase was made.
  • super-sticker-metadata alt-text=consetetur
    • Internationalized alt text that describes the sticker image and any animation associated with it.
  • alt-text-language=stet
    • Specifies the localization language in which the alt text is returned.
  • sticker-id=accusam

    • Unique identifier of the Super Sticker. This is a shorter form of the alt_text that includes pack name and a recognizable characteristic of the sticker.
  • .. tier=55

    • The tier in which the amount belongs. Lower amounts belong to lower tiers. The lowest tier is 1.
  • ..text-message-details message-text=takimata

    • The user's message.
  • .. type=sed

    • The type of message, this will always be present, it determines the contents of the message as well as which fields will be present.
  • user-banned-details ban-duration-seconds=nonumy
    • The duration of the ban. This property is only present if the banType is temporary.
  • ban-type=sea
    • The type of ban.
  • banned-user-details channel-id=eos
    • The YouTube channel ID.
  • channel-url=dolore
    • The channel's URL.
  • display-name=accusam
    • The channel's display name.
  • profile-image-url=elitr
    • The channels's avatar URL.

About Cursors

The cursor position is key to comfortably set complex nested structures. The following rules apply:

  • The cursor position is always set relative to the current one, unless the field name starts with the . character. Fields can be nested such as in -r f.s.o .
  • The cursor position is set relative to the top-level structure if it starts with ., e.g. -r .s.s
  • You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify -r struct.sub_struct=bar.
  • You can move the cursor one level up by using ... Each additional . moves it up one additional level. E.g. ... would go three levels up.

Optional Output Flags

The method's return value a JSON encoded structure, which will be written to standard output by default.

  • -o out
    • out specifies the destination to which to write the server's result to. It will be a JSON-encoded structure. The destination may be - to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.

Optional General Properties

The following properties can configure any call, and are not specific to this method.

  • -p $-xgafv=string

    • V1 error format.
  • -p access-token=string

    • OAuth access token.
  • -p alt=string

    • Data format for response.
  • -p callback=string

    • JSONP
  • -p fields=string

    • Selector specifying which fields to include in a partial response.
  • -p key=string

    • API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
  • -p oauth-token=string

    • OAuth 2.0 token for the current user.
  • -p pretty-print=boolean

    • Returns response with indentations and line breaks.
  • -p quota-user=string

    • Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
  • -p upload-type=string

    • Legacy upload protocol for media (e.g. "media", "multipart").
  • -p upload-protocol=string

    • Upload protocol for media (e.g. "raw", "multipart").