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

# Fetch content result [limited]

> Fetch content extraction result



## OpenAPI

````yaml /spec-testing.json get /v2/submission/{submission_id}/content
openapi: 3.0.1
info:
  title: Resistant Documents API
  version: 2.0.0b
  description: >-

    Resistant Documents provides this API to programmatically interact with its
    document analysis engine.

    Interaction with the API can be divided into three phases:


    1. Creating document submission

    2. Uploading a file for for analysis to an address returned from step 1.

    3. Fetching analysis results


    In the first step, the submission is created by posting to the 
    `/v2/submission` endpoint. The response contains a `submission_id` uniquely
    identifying the document to be analyzed throughout the entire interaction,
    and is used to fetch analysis results later.


    Submission response also returns `upload_url` containing a pre-signed URL.
    This URL should be used to upload the actual document to be analyzed in the
    second step. Please note the document has to be uploaded using HTTP `PUT`
    method with `Content-Type` HTTP header set to `application/octet-stream`.


    In the last step, client should repeatedly poll using the
    `/v2/submission/{submission_id}/fraud` endpoint for analysis results. The
    best practice is to use polling with an [exponential
    back-off](https://en.wikipedia.org/wiki/Exponential_backoff) to reduce load
    on the API.


    # Authentication


    <SecurityDefinitions />
servers:
  - url: https://api.documents.testing.resistant.ai
security: []
paths:
  /v2/submission/{submission_id}/content:
    get:
      summary: Fetch content result [limited]
      description: Fetch content extraction result
      operationId: getContent
      parameters:
        - in: path
          name: submission_id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            Asynchronous processing finished (either with a success or an
            error). Result of the processing is described by specific response
            object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - OAuth2:
            - submissions.read
components:
  schemas:
    ContentResponse:
      title: Engine response
      discriminator:
        propertyName: status
        mapping:
          SUCCESS:
            $ref: '#/components/schemas/ContentSuccessResponse'
          FAILED:
            $ref: '#/components/schemas/PipelineFailedResponse'
          INVALID_INPUT:
            $ref: '#/components/schemas/PipelineInvalidInputResponse'
          SKIPPED:
            $ref: '#/components/schemas/PipelineSkippedResponse'
      anyOf:
        - $ref: '#/components/schemas/ContentSuccessResponse'
        - $ref: '#/components/schemas/PipelineFailedResponse'
        - $ref: '#/components/schemas/PipelineInvalidInputResponse'
        - $ref: '#/components/schemas/PipelineSkippedResponse'
    ContentSuccessResponse:
      title: Content success response
      type: object
      properties:
        status:
          title: Status
          enum:
            - SUCCESS
          type: string
        analysis_time:
          title: Analysis time
          description: Timestamp of analysis
          type: string
        file_type:
          $ref: '#/components/schemas/FileType'
          title: File type
          description: General type of the input file
        mime_type:
          title: Mime type
          description: >-
            Mime type of the input file, e.g. `application/pdf`, `image/jpeg`,
            etc.
          minLength: 0
          maxLength: 256
          type: string
        deployment_version:
          title: Deployment version
          description: Version of quality engine used for analysis
          minLength: 0
          maxLength: 256
          type: string
        query_id:
          title: Query ID
          description: >-
            Optional customer-defined identifier for correlating this submission
            with internal systems. Must not contain PII.
          minLength: 0
          maxLength: 2048
          type: string
          nullable: true
        sha256:
          title: File sha256
          description: Sha256 of the input file
          minLength: 64
          maxLength: 64
          type: string
        contents:
          title: Parsed content
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/CardBackCze2012'
              - $ref: '#/components/schemas/CardFrontCze2012'
              - $ref: '#/components/schemas/CardBackZaf'
              - $ref: '#/components/schemas/CardFrontTha'
              - $ref: '#/components/schemas/CardFrontInd'
              - $ref: '#/components/schemas/BankAccountStatement'
              - $ref: '#/components/schemas/InvoiceContent'
              - $ref: '#/components/schemas/VrcContent'
              - $ref: '#/components/schemas/PayslipContent'
      required:
        - status
        - analysis_time
        - file_type
        - mime_type
        - deployment_version
        - query_id
        - sha256
        - contents
    PipelineFailedResponse:
      title: Pipeline failed
      type: object
      properties:
        status:
          title: Status
          enum:
            - FAILED
          type: string
        message:
          title: Error message
          minLength: 0
          maxLength: 256
          type: string
        deployment_version:
          title: Deployment version
          description: Version of analysis engine used for analysis
          minLength: 0
          maxLength: 256
          type: string
        analysis_time:
          title: Analysis time
          description: Timestamp of analysis
          type: string
        file_type:
          $ref: '#/components/schemas/FileType'
          title: File type
          description: General type of the input file
          type: string
          nullable: true
        mime_type:
          title: Mime type
          description: >-
            Mime type of the input file, e.g. `application/pdf`, `image/jpeg`,
            etc.
          minLength: 0
          maxLength: 256
          type: string
          nullable: true
        query_id:
          title: Query ID
          description: >-
            Optional customer-defined identifier for correlating this submission
            with internal systems. Must not contain PII.
          minLength: 0
          maxLength: 256
          type: string
          nullable: true
      required:
        - status
        - message
        - deployment_version
        - analysis_time
    PipelineInvalidInputResponse:
      title: Unprocessable input entity
      type: object
      properties:
        status:
          title: Status
          enum:
            - INVALID_INPUT
          type: string
        message:
          title: Error message
          minLength: 0
          maxLength: 256
          type: string
        deployment_version:
          title: Deployment version
          description: Version of analysis engine used for analysis
          minLength: 0
          maxLength: 256
          type: string
        analysis_time:
          title: Analysis time
          description: Timestamp of analysis
          type: string
        file_type:
          $ref: '#/components/schemas/FileType'
          description: General type of the input file
          title: File Type
        mime_type:
          title: Mime type
          description: >-
            Mime type of the input file, e.g. `application/pdf`, `image/jpeg`,
            etc.
          minLength: 0
          maxLength: 256
          type: string
          nullable: true
        query_id:
          title: Query ID
          description: >-
            Optional customer-defined identifier for correlating this submission
            with internal systems. Must not contain PII.
          minLength: 0
          maxLength: 256
          type: string
          nullable: true
      required:
        - status
        - message
        - deployment_version
        - analysis_time
    PipelineSkippedResponse:
      title: Pipeline was skipped
      type: object
      properties:
        status:
          title: Status
          default: SKIPPED
          enum:
            - SKIPPED
          type: string
        message:
          title: Pipeline skipped
          minLength: 0
          maxLength: 256
          type: string
        deployment_version:
          title: Deployment version
          description: Version of analysis engine used for analysis
          minLength: 0
          maxLength: 256
          type: string
        analysis_time:
          title: Analysis time
          description: Timestamp of analysis
          type: string
        query_id:
          title: Query ID
          description: >-
            Optional customer-defined identifier for correlating this submission
            with internal systems. Must not contain PII.
          minLength: 0
          maxLength: 256
          type: string
          nullable: true
      required:
        - message
        - deployment_version
        - analysis_time
    Error:
      title: Error
      type: object
      properties:
        message:
          title: Error message
          description: Detailed error message
          minLength: 0
          maxLength: 512
          type: string
      required:
        - message
    FileType:
      title: FileType
      description: Type of analyzed file
      enum:
        - unsupported
        - pdf
        - image
      type: string
    CardBackCze2012:
      title: CZE IdCard Back
      type: object
      properties:
        card_generation:
          $ref: '#/components/schemas/CardGeneration'
          title: Card generation
        issuing_country:
          title: Issuing country
          description: >-
            Country that issued this ID card, e.g. USA, DEU, FRA, CZE, SVK, etc.
            The country code is encoded with ISO-31661 alpha-3 code, see
            https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements.
          minLength: 3
          maxLength: 3
          type: string
        id_card_type:
          title: Id Card Type
          enum:
            - CzeBack2012
          type: string
        content_type:
          title: Content Type
          enum:
            - IdCard
          type: string
        personal_no:
          title: Personal No
          type: string
          nullable: true
        machine_readable_summary:
          $ref: '#/components/schemas/MachineReadableSummary'
        barcode_str:
          title: Barcode Str
          type: string
          nullable: true
        permanent_stay:
          title: Permanent Stay
          type: string
          nullable: true
        academic_degree:
          title: Academic Degree
          type: string
          nullable: true
        issued_by:
          title: Issued By
          type: string
          nullable: true
        marital_status:
          $ref: '#/components/schemas/MaritalStatus'
          nullable: true
      required:
        - card_generation
        - issuing_country
        - id_card_type
        - content_type
        - machine_readable_summary
    CardFrontCze2012:
      title: CZE IdCard Front
      type: object
      properties:
        card_generation:
          $ref: '#/components/schemas/CardGeneration'
          title: Card generation
        issuing_country:
          title: Issuing country
          description: >-
            Country that issued this ID card, e.g. USA, DEU, FRA, CZE, SVK, etc.
            The country code is encoded with ISO-31661 alpha-3 code, see
            https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements.
          minLength: 3
          maxLength: 3
          type: string
        id_card_type:
          title: Id Card Type
          enum:
            - CzeFront2012
          type: string
        content_type:
          title: Content Type
          enum:
            - IdCard
          type: string
        first_name:
          title: First Name
          type: string
          nullable: true
        last_name:
          title: Last Name
          type: string
          nullable: true
        card_no:
          title: Card No
          type: integer
          nullable: true
        date_of_birth_str:
          title: Date Of Birth Str
          type: string
          nullable: true
        date_of_expiry_str:
          title: Date Of Expiry Str
          type: string
          nullable: true
        nationality:
          title: Nationality
          type: string
          nullable: true
        date_of_issue_str:
          title: Date Of Issue Str
          type: string
          nullable: true
        place_of_birth:
          title: Place Of Birth
          type: string
          nullable: true
        sex:
          $ref: '#/components/schemas/Sex'
          nullable: true
      required:
        - card_generation
        - issuing_country
        - id_card_type
        - content_type
    CardBackZaf:
      title: ZAF IdCard Back
      type: object
      properties:
        card_generation:
          $ref: '#/components/schemas/CardGeneration'
          title: Card generation
        issuing_country:
          title: Issuing country
          description: >-
            Country that issued this ID card, e.g. USA, DEU, FRA, CZE, SVK, etc.
            The country code is encoded with ISO-31661 alpha-3 code, see
            https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements.
          minLength: 3
          maxLength: 3
          type: string
        id_card_type:
          title: Id Card Type
          enum:
            - ZafBack
          type: string
        content_type:
          title: Content Type
          enum:
            - IdCard
          type: string
        card_no_str:
          title: Card No Str
          type: string
          nullable: true
        barcode_str:
          title: Barcode Str
          type: string
          nullable: true
      required:
        - card_generation
        - issuing_country
        - id_card_type
        - content_type
    CardFrontTha:
      title: THA IdCard Front
      type: object
      properties:
        card_generation:
          $ref: '#/components/schemas/CardGeneration'
          title: Card generation
        issuing_country:
          title: Issuing country
          description: >-
            Country that issued this ID card, e.g. USA, DEU, FRA, CZE, SVK, etc.
            The country code is encoded with ISO-31661 alpha-3 code, see
            https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements.
          minLength: 3
          maxLength: 3
          type: string
        id_card_type:
          title: Id Card Type
          enum:
            - ThaFront
          type: string
        content_type:
          title: Content Type
          enum:
            - IdCard
          type: string
        card_no_str:
          title: Card No Str
          type: string
          nullable: true
        barcode_str:
          title: Barcode Str
          type: string
          nullable: true
      required:
        - card_generation
        - issuing_country
        - id_card_type
        - content_type
    CardFrontInd:
      title: IND IdCard Front
      type: object
      properties:
        card_generation:
          $ref: '#/components/schemas/CardGeneration'
          title: Card generation
        issuing_country:
          title: Issuing country
          description: >-
            Country that issued this ID card, e.g. USA, DEU, FRA, CZE, SVK, etc.
            The country code is encoded with ISO-31661 alpha-3 code, see
            https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements.
          minLength: 3
          maxLength: 3
          type: string
        id_card_type:
          title: Id Card Type
          enum:
            - IndFront
          type: string
        content_type:
          title: Content Type
          enum:
            - IdCard
          type: string
        card_no_str:
          title: Card No Str
          type: string
          nullable: true
        barcode_str:
          title: Barcode Str
          type: string
          nullable: true
      required:
        - card_generation
        - issuing_country
        - id_card_type
        - content_type
    BankAccountStatement:
      title: BankAccountStatement
      type: object
      properties:
        content_type:
          title: Content Type
          enum:
            - BankAccountStatement
          type: string
        country:
          $ref: '#/components/schemas/SupportedCountry'
          title: Country in which the account is held
        bank:
          $ref: '#/components/schemas/SupportedBank'
          title: Bank name
        transactions:
          title: Transactions in bank account statement
          type: array
          items:
            $ref: '#/components/schemas/BankAccountTransaction'
        account_number:
          title: Account number
          description: Unique identifier of an account within the bank
          type: string
          nullable: true
        iban:
          title: Account IBAN
          type: string
          nullable: true
        bic:
          title: Account BIC
          description: Unique identifier of an account within the bank
          type: string
          nullable: true
        start_date:
          title: Account statement start date
          description: First day of the time period covered by the account statement
          type: string
          format: date
          nullable: true
        end_date:
          title: Account statement end date
          description: Last day of the time period covered by the account statement
          type: string
          format: date
          nullable: true
        account_currency:
          title: Account currency
          type: string
          nullable: true
        statement_periodicity:
          title: Statement periodicity
          description: >-
            Periodicity with which the account statement is generated, e.g.
            monthly, querterly, yerly
          type: string
          nullable: true
        statement_generation_date:
          title: Statement generation date
          description: Date on which the account statement was generated
          type: string
          format: date
          nullable: true
        account_balance_start:
          title: Starting account balance
          description: >-
            Account balance at the start of the period covered by the account
            statement
          type: number
          nullable: true
        account_balance_end:
          title: Ending account balance
          description: >-
            Account balance at the end of the period covered by the account
            statement
          type: number
          nullable: true
        credit_transactions_sum:
          title: Sum of credit transactions covered by account statement
          type: number
          nullable: true
        debit_transactions_sum:
          title: Sum of debit transactions covered by account statement
          type: number
          nullable: true
        account_type:
          title: Account type
          type: string
          nullable: true
        statement_id:
          title: Statement id
          description: >-
            Statement ID can be the ordinal number of the statement, or month
            number it covers, etc.
          type: string
          nullable: true
        account_owner_name:
          title: Account owner name
          description: Name of the owner of the account
          type: string
          nullable: true
        account_owner_address:
          title: Account owner address
          description: Address of the owner of the account
          type: array
          items:
            type: string
          nullable: true
      required:
        - content_type
        - country
        - bank
        - transactions
    InvoiceContent:
      title: Invoice content
      type: object
      properties:
        content:
          title: Non-normalized invoice content
          type: object
          additionalProperties:
            nullable: true
        content_type:
          title: Content Type
          enum:
            - invoice
          type: string
      required:
        - content
        - content_type
    VrcContent:
      title: VrcContent
      type: object
      properties:
        vin:
          title: Vehicle identification number
          type: string
        content_type:
          title: Content Type
          enum:
            - VRC
          type: string
      required:
        - vin
        - content_type
    PayslipContent:
      title: PayslipContent
      type: object
      properties:
        issuer:
          title: Issuer of the document
          type: string
          nullable: true
        version:
          title: Version of the document
          type: string
          nullable: true
        bank_account_number:
          title: Employee account number to which salary is paid
          type: string
          nullable: true
        bank_name:
          title: Employee's bank
          type: string
          nullable: true
        billing_month:
          $ref: '#/components/schemas/BillingMonth'
          title: Billing month
          type: object
          nullable: true
        employment_start:
          title: Employment start date
          description: Date in isoformat
          type: string
          nullable: true
        employment_end:
          title: Employment end date
          description: Date in isoformat
          type: string
          nullable: true
        employee_identity:
          title: Identity of the employee.
          description: >-
            Field can contain information such as employee name, employee
            address
          type: array
          items:
            type: string
        net_payout:
          title: Net payout for the given billing month.
          type: number
          nullable: true
        special_payments:
          title: Special payments to the employee
          type: array
          items:
            $ref: '#/components/schemas/SpecialPayment'
        content_type:
          title: Content Type
          enum:
            - Payslip
          type: string
      required:
        - employee_identity
        - special_payments
        - content_type
    CardGeneration:
      title: CardGeneration
      description: An enumeration.
      enum:
        - UNKNOWN
        - ISSUED_BEFORE_2012
        - ISSUED_AFTER_2012
      type: string
    MachineReadableSummary:
      title: MachineReadableSummary
      type: object
      properties:
        raw_lines:
          title: Raw Lines
          type: array
          items:
            type: string
        date_of_birth_str:
          title: Date Of Birth Str
          type: string
          nullable: true
        date_of_expiration_str:
          title: Date Of Expiration Str
          type: string
          nullable: true
        card_no:
          title: Card No
          type: integer
          nullable: true
        last_name:
          title: Last Name
          type: string
          nullable: true
        first_name:
          title: First Name
          type: string
          nullable: true
        nationality:
          title: Nationality
          minLength: 3
          maxLength: 3
          type: string
          nullable: true
        sex:
          title: Sex
          type: string
          nullable: true
      required:
        - raw_lines
    MaritalStatus:
      title: MaritalStatus
      description: An enumeration.
      enum:
        - UNKNOWN
        - SINGLE
        - MARRIED
        - DIVORCED
        - WIDOWED
      type: string
    Sex:
      title: Sex
      description: An enumeration.
      enum:
        - <
        - M
        - F
      type: string
    SupportedCountry:
      title: SupportedCountry
      description: An enumeration.
      enum:
        - CZ
      type: string
    SupportedBank:
      title: SupportedBank
      description: An enumeration.
      enum:
        - airbank
        - ceska_sporitelna
        - ceskoslovenska_obchodni_banka
        - equa
        - fio
        - komercni_banka
        - mbank
        - moneta
        - raiffeisen
        - unicredit
      type: string
    BankAccountTransaction:
      title: BankAccountTransaction
      type: object
      properties:
        country:
          $ref: '#/components/schemas/SupportedCountry'
          title: Country in which the account is held
        accounting_date:
          title: Transaction accounting date
          type: string
          format: date
          nullable: true
        transaction_date:
          title: Transaction date
          type: string
          format: date
          nullable: true
        operation_type:
          title: Type of transaction
          type: string
          nullable: true
        operation_id:
          title: Operation ID
          description: Operation ID that is unique within a bank
          type: string
          nullable: true
        message_for_recipient:
          title: Message displayed to recipient
          type: string
          nullable: true
        message_for_sender:
          title: Message displayed to sender
          type: string
          nullable: true
        detail:
          title: Transaction additional description
          type: array
          items:
            type: string
          nullable: true
        counterparty_account_number:
          title: Recipient's account number
          type: string
          nullable: true
        counterparty_account_name:
          title: Recipient's account name
          description: Can be name of the owner of counteraccount
          type: string
          nullable: true
        amount:
          title: Transaction amount
          type: number
          nullable: true
      required:
        - country
    BillingMonth:
      title: BillingMonth
      type: object
      properties:
        month:
          title: Billing month
          type: integer
        year:
          title: Billing year
          type: integer
      required:
        - month
        - year
    SpecialPayment:
      title: SpecialPayment
      type: object
      properties:
        description:
          title: Special payment description
          type: string
        amount:
          title: Payment amount
          type: number
        identification:
          title: Payment ID
          type: string
          nullable: true
      required:
        - description
        - amount
  responses:
    BadRequest:
      description: Bad request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing valid authentication credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Access to the requested resource is forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnsupportedMediaType:
      description: Unsupported media type.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Request quota was exceeded
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://eu.id.resistant.ai/oauth2/aus17c52xbW6c0yA9417/v1/token
          scopes:
            submissions.read: Read analysis results for a submission
            submissions.write: Create a new submission

````