:doc:`APIGateway <../../apigateway>` / Client / import_api_keys

***************
import_api_keys
***************



.. py:method:: APIGateway.Client.import_api_keys(**kwargs)

  

  Import API keys from an external source, such as a CSV-formatted file.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/apigateway-2015-07-09/ImportApiKeys>`_  


  **Request Syntax**
  ::

    response = client.import_api_keys(
        body=b'bytes'|file,
        format='csv',
        failOnWarnings=True|False
    )
    
  :type body: bytes or seekable file-like object
  :param body: **[REQUIRED]** 

    The payload of the POST request to import API keys. For the payload format, see API Key File Format.

    

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

    A query parameter to specify the input format to imported API keys. Currently, only the ``csv`` format is supported.

    

  
  :type failOnWarnings: boolean
  :param failOnWarnings: 

    A query parameter to indicate whether to rollback ApiKey importation ( ``true``) or not ( ``false``) when error is encountered.

    

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

    
    ::

      {
          'ids': [
              'string',
          ],
          'warnings': [
              'string',
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The identifier of an ApiKey used in a UsagePlan.

      
      

      - **ids** *(list) --* 

        A list of all the ApiKey identifiers.

        
        

        - *(string) --* 
    
      

      - **warnings** *(list) --* 

        A list of warning messages.

        
        

        - *(string) --* 
    
  
  **Exceptions**
  
  *   :py:class:`APIGateway.Client.exceptions.BadRequestException`

  
  *   :py:class:`APIGateway.Client.exceptions.ConflictException`

  
  *   :py:class:`APIGateway.Client.exceptions.LimitExceededException`

  
  *   :py:class:`APIGateway.Client.exceptions.NotFoundException`

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

  
  *   :py:class:`APIGateway.Client.exceptions.TooManyRequestsException`

  