:doc:`QConnect <../../qconnect>` / Client / start_import_job

****************
start_import_job
****************



.. py:method:: QConnect.Client.start_import_job(**kwargs)

  

  Start an asynchronous job to import Amazon Q in Connect resources from an uploaded source file. Before calling this API, use `StartContentUpload <https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html>`__ to upload an asset that contains the resource data.

   

  
  * For importing Amazon Q in Connect quick responses, you need to upload a csv file including the quick responses. For information about how to format the csv file for importing quick responses, see `Import quick responses <https://docs.aws.amazon.com/console/connect/quick-responses/add-data>`__.
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/StartImportJob>`_  


  **Request Syntax**
  ::

    response = client.start_import_job(
        knowledgeBaseId='string',
        importJobType='QUICK_RESPONSES',
        uploadId='string',
        clientToken='string',
        metadata={
            'string': 'string'
        },
        externalSourceConfiguration={
            'source': 'AMAZON_CONNECT',
            'configuration': {
                'connectConfiguration': {
                    'instanceId': 'string'
                }
            }
        }
    )
    
  :type knowledgeBaseId: string
  :param knowledgeBaseId: **[REQUIRED]** 

    The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

     

    
    * For importing Amazon Q in Connect quick responses, this should be a ``QUICK_RESPONSES`` type knowledge base.
    

    

  
  :type importJobType: string
  :param importJobType: **[REQUIRED]** 

    The type of the import job.

     

    
    * For importing quick response resource, set the value to ``QUICK_RESPONSES``.
    

    

  
  :type uploadId: string
  :param uploadId: **[REQUIRED]** 

    A pointer to the uploaded asset. This value is returned by `StartContentUpload <https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html>`__.

    

  
  :type clientToken: string
  :param clientToken: 

    The tags used to organize, track, or control access for this resource.

    This field is autopopulated if not provided.

  
  :type metadata: dict
  :param metadata: 

    The metadata fields of the imported Amazon Q in Connect resources.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  :type externalSourceConfiguration: dict
  :param externalSourceConfiguration: 

    The configuration information of the external source that the resource data are imported from.

    

  
    - **source** *(string) --* **[REQUIRED]** 

      The type of the external data source.

      

    
    - **configuration** *(dict) --* **[REQUIRED]** 

      The configuration information of the external data source.

      .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``connectConfiguration``. 

    
      - **connectConfiguration** *(dict) --* 

        The configuration information of the Amazon Connect data source.

        

      
        - **instanceId** *(string) --* 

          The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.

          

        
      
    
  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'importJob': {
              'importJobId': 'string',
              'knowledgeBaseId': 'string',
              'uploadId': 'string',
              'knowledgeBaseArn': 'string',
              'importJobType': 'QUICK_RESPONSES',
              'status': 'START_IN_PROGRESS'|'FAILED'|'COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETED',
              'url': 'string',
              'failedRecordReport': 'string',
              'urlExpiry': datetime(2015, 1, 1),
              'createdTime': datetime(2015, 1, 1),
              'lastModifiedTime': datetime(2015, 1, 1),
              'metadata': {
                  'string': 'string'
              },
              'externalSourceConfiguration': {
                  'source': 'AMAZON_CONNECT',
                  'configuration': {
                      'connectConfiguration': {
                          'instanceId': 'string'
                      }
                  }
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **importJob** *(dict) --* 

        The import job.

        
        

        - **importJobId** *(string) --* 

          The identifier of the import job.

          
        

        - **knowledgeBaseId** *(string) --* 

          The identifier of the knowledge base.

          
        

        - **uploadId** *(string) --* 

          A pointer to the uploaded asset. This value is returned by `StartContentUpload <https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html>`__.

          
        

        - **knowledgeBaseArn** *(string) --* 

          The Amazon Resource Name (ARN) of the knowledge base.

          
        

        - **importJobType** *(string) --* 

          The type of the import job.

          
        

        - **status** *(string) --* 

          The status of the import job.

          
        

        - **url** *(string) --* 

          The download link to the resource file that is uploaded to the import job.

          
        

        - **failedRecordReport** *(string) --* 

          The link to download the information of resource data that failed to be imported.

          
        

        - **urlExpiry** *(datetime) --* 

          The expiration time of the URL as an epoch timestamp.

          
        

        - **createdTime** *(datetime) --* 

          The timestamp when the import job was created.

          
        

        - **lastModifiedTime** *(datetime) --* 

          The timestamp when the import job data was last modified.

          
        

        - **metadata** *(dict) --* 

          The metadata fields of the imported Amazon Q in Connect resources.

          
          

          - *(string) --* 
            

            - *(string) --* 
      
    
        

        - **externalSourceConfiguration** *(dict) --* 

          The configuration information of the external data source.

          
          

          - **source** *(string) --* 

            The type of the external data source.

            
          

          - **configuration** *(dict) --* 

            The configuration information of the external data source.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``connectConfiguration``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


          
            

            - **connectConfiguration** *(dict) --* 

              The configuration information of the Amazon Connect data source.

              
              

              - **instanceId** *(string) --* 

                The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.

                
          
        
      
    
  
  **Exceptions**
  
  *   :py:class:`QConnect.Client.exceptions.ConflictException`

  
  *   :py:class:`QConnect.Client.exceptions.ValidationException`

  
  *   :py:class:`QConnect.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`QConnect.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`QConnect.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`QConnect.Client.exceptions.ResourceNotFoundException`

  