:doc:`IoT <../../iot>` / Client / get_registration_code

*********************
get_registration_code
*********************



.. py:method:: IoT.Client.get_registration_code()

  

  Gets a registration code used to register a CA certificate with IoT.

   

  IoT will create a registration code as part of this API call if the registration code doesn't exist or has been deleted. If you already have a registration code, this API call will return the same registration code.

   

  Requires permission to access the `GetRegistrationCode <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetRegistrationCode>`_  


  **Request Syntax**
  ::

    response = client.get_registration_code()
    
    
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'registrationCode': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The output from the GetRegistrationCode operation.

      
      

      - **registrationCode** *(string) --* 

        The CA certificate registration code.

        
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.ThrottlingException`

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

  
  *   :py:class:`IoT.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

  