Inserts a new annotation.

Scopes

You will need authorization for the https://www.googleapis.com/auth/books scope to make a valid call.

If unset, the scope for this method defaults to https://www.googleapis.com/auth/books. You can set the scope for this method like this: books1 --scope <scope> mylibrary annotations-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:

Annotation:
  after-selected-text: string
  before-selected-text: string
  client-version-ranges:
    cfi-range:
      end-offset: string
      end-position: string
      start-offset: string
      start-position: string
    content-version: string
    gb-image-range:
      end-offset: string
      end-position: string
      start-offset: string
      start-position: string
    gb-text-range:
      end-offset: string
      end-position: string
      start-offset: string
      start-position: string
    image-cfi-range:
      end-offset: string
      end-position: string
      start-offset: string
      start-position: string
  created: string
  current-version-ranges:
    cfi-range:
      end-offset: string
      end-position: string
      start-offset: string
      start-position: string
    content-version: string
    gb-image-range:
      end-offset: string
      end-position: string
      start-offset: string
      start-position: string
    gb-text-range:
      end-offset: string
      end-position: string
      start-offset: string
      start-position: string
    image-cfi-range:
      end-offset: string
      end-position: string
      start-offset: string
      start-position: string
  data: string
  deleted: boolean
  highlight-style: string
  id: string
  kind: string
  layer-id: string
  layer-summary:
    allowed-character-count: integer
    limit-type: string
    remaining-character-count: integer
  page-ids: [string]
  selected-text: string
  self-link: string
  updated: string
  volume-id: 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 . after-selected-text=gubergren
    • Anchor text after excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty.
  • before-selected-text=lorem
    • Anchor text before excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty.
  • client-version-ranges.cfi-range end-offset=gubergren
    • The offset from the ending position.
  • end-position=eos
    • The ending position for the range.
  • start-offset=dolor
    • The offset from the starting position.
  • start-position=ea

    • The starting position for the range.
  • .. content-version=ipsum

    • Content version the client sent in.
  • gb-image-range end-offset=invidunt
    • The offset from the ending position.
  • end-position=amet
    • The ending position for the range.
  • start-offset=duo
    • The offset from the starting position.
  • start-position=ipsum

    • The starting position for the range.
  • ..gb-text-range end-offset=sed

    • The offset from the ending position.
  • end-position=ut
    • The ending position for the range.
  • start-offset=gubergren
    • The offset from the starting position.
  • start-position=rebum.

    • The starting position for the range.
  • ..image-cfi-range end-offset=est

    • The offset from the ending position.
  • end-position=ipsum
    • The ending position for the range.
  • start-offset=ipsum
    • The offset from the starting position.
  • start-position=est

    • The starting position for the range.
  • ... created=gubergren

    • Timestamp for the created time of this annotation.
  • current-version-ranges.cfi-range end-offset=ea
    • The offset from the ending position.
  • end-position=dolor
    • The ending position for the range.
  • start-offset=lorem
    • The offset from the starting position.
  • start-position=eos

    • The starting position for the range.
  • .. content-version=labore

    • Content version applicable to ranges below.
  • gb-image-range end-offset=sed
    • The offset from the ending position.
  • end-position=duo
    • The ending position for the range.
  • start-offset=sed
    • The offset from the starting position.
  • start-position=no

    • The starting position for the range.
  • ..gb-text-range end-offset=stet

    • The offset from the ending position.
  • end-position=kasd
    • The ending position for the range.
  • start-offset=et
    • The offset from the starting position.
  • start-position=sed

    • The starting position for the range.
  • ..image-cfi-range end-offset=et

    • The offset from the ending position.
  • end-position=et
    • The ending position for the range.
  • start-offset=vero
    • The offset from the starting position.
  • start-position=erat

    • The starting position for the range.
  • ... data=sed

    • User-created data for this annotation.
  • deleted=false
    • Indicates that this annotation is deleted.
  • highlight-style=diam
    • The highlight style for this annotation.
  • id=dolor
    • Id of this annotation, in the form of a GUID.
  • kind=et
    • Resource type.
  • layer-id=et
    • The layer this annotation is for.
  • layer-summary allowed-character-count=6
    • Maximum allowed characters on this layer, especially for the "copy" layer.
  • limit-type=stet
    • Type of limitation on this layer. "limited" or "unlimited" for the "copy" layer.
  • remaining-character-count=2

    • Remaining allowed characters on this layer, especially for the "copy" layer.
  • .. page-ids=duo

    • Pages that this annotation spans.
    • Each invocation of this argument appends the given value to the array.
  • selected-text=vero
    • Excerpt from the volume.
  • self-link=vero
    • URL to this resource.
  • updated=invidunt
    • Timestamp for the last time this annotation was modified.
  • volume-id=stet
    • The volume that this annotation belongs to.

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 Method Properties

You may set the following properties to further configure the call. Please note that -p is followed by one or more key-value-pairs, and is called like this -p k1=v1 k2=v2 even though the listing below repeats the -p for completeness.

  • -p annotation-id=string

    • The ID for the annotation to insert.
  • -p country=string

    • ISO-3166-1 code to override the IP-based location.
  • -p show-only-summary-in-response=boolean

    • Requests that only the summary of the specified layer be provided in the response.
  • -p source=string

    • String to identify the originator of this request.

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").