> ## Documentation Index
> Fetch the complete documentation index at: https://docs.olostep.com/llms.txt
> Use this file to discover all available pages before exploring further.

# バッチアイテム

> バッチで処理されたアイテムのリストを取得します。その後、`retrieve_id` を使用して Retrieve エンドポイントでコンテンツを取得できます。

<Tip>
  **メタデータ:** [バッチを作成する](/api-reference/batches/create)際に個々のアイテムに `metadata` を添付した場合、レスポンス内の各アイテムにそのメタデータが返されます。
</Tip>


## OpenAPI

````yaml ja/openapi/batches.json GET /v1/batches/{batch_id}/items
openapi: 3.0.3
info:
  title: バッチ API
  version: 1.0.0
servers:
  - url: https://api.olostep.com
security: []
paths:
  /v1/batches/{batch_id}/items:
    get:
      summary: 特定のバッチに対して完了または失敗したアイテムリストをオプションでコンテンツと共に取得
      description: 特定のバッチIDに対して、リクエストされたステータスに基づくアイテムとコンテンツのリストを取得します。
      parameters:
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
          description: アイテムを取得するバッチのID。
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - completed
              - failed
          description: 取得するURLのステータス（completedまたはfailed）。
        - name: cursor
          in: query
          required: false
          schema:
            type: integer
          description: >-
            ページネーションカーソル。最初のリクエストではこのパラメータを省略してください。次のリクエストでは、前のレスポンスからの`cursor`値を使用してください。詳細は[ページネーション](/api-reference/common/pagination)を参照してください。
        - name: limit
          in: query
          required: false
          schema:
            type: integer
          description: 返す結果の数（推奨は10〜50）。
      responses:
        '200':
          description: バッチアイテムの成功したレスポンス。
          content:
            application/json:
              schema:
                type: object
                properties:
                  batch_id:
                    type: string
                  object:
                    type: string
                  status:
                    type: string
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        custom_id:
                          type: string
                        retrieve_id:
                          type: string
                        url:
                          type: string
                        metadata:
                          allOf:
                            - $ref: '#/components/schemas/Metadata'
                          description: バッチ作成時に提供された場合のアイテムレベルのメタデータ。
                        links_on_page:
                          type: array
                          items:
                            type: string
                  items_count:
                    type: integer
                  cursor:
                    type: integer
                    description: >-
                      ページネーションカーソル。さらに結果がある場合に表示されます。この値を次のリクエストの`cursor`パラメータで使用してください。詳細は[ページネーション](/api-reference/common/pagination)を参照してください。
              example:
                batch_id: batch_abc123def456
                object: list
                status: completed
                items:
                  - custom_id: product-123
                    retrieve_id: ret_xyz789
                    url: https://example.com/product/123
                    metadata:
                      source: catalog_sync
                      priority: high
                  - custom_id: product-456
                    retrieve_id: ret_abc456
                    url: https://example.com/product/456
                items_count: 2
        '400':
          description: >-
            不正なパラメータによる不正リクエスト。詳細は[不正リクエスト](/api-reference/errors/bad_request)を参照してください。
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                id: error_abc123
                object: error
                code: validation_error
                type: https://docs.olostep.com/api-reference/errors/bad_request
                status: 400
                title: 不正なリクエスト
                detail: Status must be either 'completed' or 'failed'
                created: 1704067200
                metadata: {}
        '401':
          description: >-
            認証情報が欠落しているか無効です。詳細は
            [Unauthorized](/api-reference/errors/unauthorized) を参照してください。
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                id: error_abc123
                object: error
                code: invalid_api_key
                type: https://docs.olostep.com/api-reference/errors/unauthorized
                status: 401
                title: 認証されていません
                detail: Your API key is invalid
                created: 1704067200
                metadata: {}
        '404':
          description: >-
            提供されたIDに対するバッチが見つかりません。詳細は[見つかりません](/api-reference/errors/not_found)を参照してください。
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                id: error_abc123
                object: error
                code: batch_not_found
                type: https://docs.olostep.com/api-reference/errors/not_found
                status: 404
                title: 見つかりません
                detail: Batch not found
                created: 1704067200
                metadata: {}
        '500':
          description: >-
            内部サーバーエラー。詳細は [Internal Error](/api-reference/errors/internal_error)
            を参照してください。
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                id: error_abc123
                object: error
                code: internal_server_error
                type: https://docs.olostep.com/api-reference/errors/internal_error
                status: 500
                title: 内部サーバーエラー
                detail: An unexpected error occurred
                created: 1704067200
                metadata: {}
      security:
        - Authorization: []
components:
  schemas:
    Metadata:
      type: object
      description: >-
        オブジェクトに関する追加情報を保存するためのキーと値のペアのセット。Stripeのアプローチに従い、検証ルールがあります：最大50キー、キーは最大40文字（角括弧なし）、値は最大500文字、すべての値は文字列として保存されます。
      additionalProperties:
        type: string
        maxLength: 500
        description: メタデータの値（最大500文字）。数値とブール値は自動的に文字列に変換されます。
      maxProperties: 50
      example:
        order_id: '12345'
        customer_name: John Doe
        priority: high
        processed: 'true'
      x-validation-rules:
        max_keys: 50
        key_max_length: 40
        key_forbidden_chars:
          - '['
          - ']'
        value_max_length: 500
        value_types:
          - string
          - number (coerced)
          - boolean (coerced)
    Error:
      type: object
      description: RFC 7807 問題の詳細エラーレスポンス
      properties:
        id:
          type: string
          description: ユニークなエラー識別子
        object:
          type: string
          enum:
            - error
          description: 常に 'error'
        code:
          type: string
          description: 機械可読なエラーコード
        type:
          type: string
          format: uri
          description: 問題タイプを識別するURI参照
        status:
          type: integer
          description: HTTPステータスコード
        title:
          type: string
          description: 短い、人間が読める要約
        detail:
          type: string
          description: 人間が読める説明
        created:
          type: integer
          description: Unixタイムスタンプ
        metadata:
          $ref: '#/components/schemas/Metadata'
        errors:
          type: array
          description: 追加のエラー詳細のオプション配列
          items: {}
      required:
        - id
        - object
        - code
        - type
        - status
        - title
        - detail
        - created
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: Bearer <token>形式のBearer認証ヘッダー。<token>はあなたの認証トークンです。

````