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

# Get Batch Task Infos By Name And State

> Gets an array of user BatchTaskInfo with state defined by a BatchTaskState and the batchtask definition name.

NsApiSlow threshold: 3000 ms.



## OpenAPI

````yaml /openapi/agent/openapi-v3-BatchAgent.json post /api/v1/Agents/Batch/GetBatchTaskInfosByNameAndState
openapi: 3.0.0
info:
  version: v1-Agents
  title: SuperOffice Agent API v1
  description: SuperOffice Agent API - BatchAgent
  contact:
    name: SuperOffice DevNet
    url: https://docs.superoffice.com/en/api/index.html
    email: sdk@superoffice.com
servers:
  - url: http://localhost:56350
  - url: https://localhost:56350
security: []
tags: []
externalDocs:
  description: >-
    The SuperOffice DevNet Community has more documentation, examples, and
    discussion forums.
  url: https://community.superoffice.com/en/developer/
paths:
  /api/v1/Agents/Batch/GetBatchTaskInfosByNameAndState:
    post:
      tags:
        - Batch_Agent
      summary: Get Batch Task Infos By Name And State
      description: >-
        Gets an array of user BatchTaskInfo with state defined by a
        BatchTaskState and the batchtask definition name.


        NsApiSlow threshold: 3000 ms.
      operationId: v1BatchAgent_GetBatchTaskInfosByNameAndState
      parameters:
        - name: $select
          in: query
          description: >-
            Optional comma separated list of properties to include in the
            result. Other fields are then nulled out to reduce payload size:
            "Name,department,category". Default = show all fields.
          required: false
          schema:
            type: string
        - name: Accept-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code.
          required: false
          schema:
            type: string
        - name: SO-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code. Overrides Accept-Language value.
          required: false
          schema:
            type: string
        - name: SO-Culture
          in: header
          description: >-
            Number, date formatting in a specified culture (iso2 language) code.
            Partially overrides SO-Language/Accept-Language value. Ignored if no
            Language set.
          required: false
          schema:
            type: string
        - name: SO-TimeZone
          in: header
          description: >-
            Specify the timezone code that you would like date/time responses
            converted to.
          required: false
          schema:
            type: string
        - name: SO-AppToken
          in: header
          description: >-
            The application token that identifies the partner app. Used when
            calling Online WebAPI from a server.
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.BatchCarriers.GetBatchTaskInfosByNameAndStateRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.BatchCarriers.GetBatchTaskInfosByNameAndStateRequest
          application/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.BatchCarriers.GetBatchTaskInfosByNameAndStateRequest
          text/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.BatchCarriers.GetBatchTaskInfosByNameAndStateRequest
          application/x-www-form-urlencoded:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.BatchCarriers.GetBatchTaskInfosByNameAndStateRequest
          application/json-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.BatchCarriers.GetBatchTaskInfosByNameAndStateRequest
          application/merge-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.BatchCarriers.GetBatchTaskInfosByNameAndStateRequest
        description: Name, State
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.BatchTaskInfo'
            text/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.BatchTaskInfo'
            application/xml:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.BatchTaskInfo'
            text/xml:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.BatchTaskInfo'
            application/json-patch+json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.BatchTaskInfo'
            application/merge-patch+json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.BatchTaskInfo'
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.WebApi.v1.Carriers.BatchCarriers.GetBatchTaskInfosByNameAndStateRequest:
      description: >-
        GetBatchTaskInfosByNameAndState: Gets an array of user BatchTaskInfo
        with state defined by a BatchTaskState and the batchtask definition
        name.
      type: object
      properties:
        Name:
          type: string
        State:
          enum:
            - Unknown
            - New
            - Aquired
            - Started
            - Succeeded
            - Failed
            - SucceededManualCleanup
            - All
          type: string
    SuperOffice.CRM.Services.BatchTaskInfo:
      description: "BatchTaskInfo contains information about one batch task.\r\n<para />\r\nCarrier object for BatchTaskInfo.\r\nServices for the BatchTaskInfo Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IBatchAgent\">Batch Agent</see>."
      type: object
      properties:
        Id:
          format: int32
          description: Id of the task.
          type: integer
        Name:
          description: Name of the task.
          type: string
        AssociateId:
          format: int32
          description: Task owner. If it is a System task, AssociateId = 0.
          type: integer
        DetailsTable:
          format: int32
          description: Id of table with more information about the task.
          type: integer
        DetailsRecord:
          format: int32
          description: >-
            Record Id of a row in the DetailsTable containing more info about
            the task.
          type: integer
        IsSystemTask:
          description: If IsSystemTask is true, the task is not initiated by an associate.
          type: boolean
        IsInternalTask:
          description: >-
            If IsInternalTask is true, this task will not add a trace to the
            database.
          type: boolean
        ParameterObject:
          description: >-
            ParameterObject will be serialized to a binary blob and saved in the
            BinaryObject table. The link to the BinaryObject will be set using
            DetailsTable and DetailsRecord.
          type: object
          additionalProperties:
            type: string
        LastStarted:
          format: date-time
          description: When was the task last started.
          type: string
        Created:
          format: date-time
          description: Task creation time.
          type: string
        StartCount:
          format: int32
          description: Maps to the startcount field in the batchtask table.
          type: integer
        DatabaseSerialNumber:
          description: Serial number of the database the task is to run on.
          type: string
        Context:
          description: Context for the executing task.
          type: string
        Result:
          description: Maps to the result field in the batchtask table.
          type: string
        State:
          description: BatchTaskState of the task.
          enum:
            - Unknown
            - New
            - Aquired
            - Started
            - Succeeded
            - Failed
            - SucceededManualCleanup
            - All
          type: string
        Description:
          description: Description of the task.
          type: string
        Response:
          description: Maps to the response field in the batchtask table.
          type: string
        Request:
          description: Maps to the request field in the batchtask table.
          type: string
        ProgressDescription:
          description: Descriptive text for the current stage
          type: string
        ProgressPercent:
          format: int32
          description: Task progress, in percent of estimated total
          type: integer
        FileName:
          description: The filename related to the batchtask.
          type: string
        CancellationBehaviour:
          description: Indicate if the task can be stopped.
          enum:
            - CanCancel
            - CancelWithWarning
            - CannotCancel
          type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Security.TableRight:
      description: "Wraps a table right together with an explanatory reason.\r\nCode can indicate why access is restricted."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string
    SuperOffice.CRM.Security.FieldProperty:
      description: >-
        Class holding properties like field length, field type about a field in
        the carrier.
      type: object
      properties:
        FieldRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldRight'
        FieldType:
          type: string
        FieldLength:
          format: int32
          description: ''
          type: integer
    SuperOffice.CRM.Security.FieldRight:
      description: "Wraps the field right together with an explanatory reason.\r\nAlso adds logical operators to the field rights so that they can be easily combined."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string

````

## Related topics

- [SuperOffice.WebApi.Data.Batch GetBatchTaskInfosByNameAndStateRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Batch_GetBatchTaskInfosByNameAndStateRequest.md)
- [NSBatchAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSBatchAgent.md)
- [SuperOffice.WebApi.Agents.BatchAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.BatchAgent.md)
- [SuperOffice.WebApi.Agents.IBatchAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IBatchAgent.md)
- [Get All Batch Task Infos By Name And State](/en/api/reference/restful/agent/batch_agent/get-all-batch-task-infos-by-name-and-state.md)
- [Get System Batch Task Infos By Name And State](/en/api/reference/restful/agent/batch_agent/get-system-batch-task-infos-by-name-and-state.md)
