.. index:: 
  !DocumentLicense.activate Method
  
.. _id3_document_document_license_activate_class_method:

===============================================================================
DocumentLicense.activate Method
===============================================================================

Module: :ref:`DocumentLicense<id3_document_document_license_class>`

Definition
----------

Activates a license using customer credentials and a product reference and saves the license to a file.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        @staticmethod
        activate(hardware_code: str, login: str, password: str, product_reference: str, commentary: str, path: str) -> None

      **Parameters**

        .. line-block::

          ``hardware_code`` str
          :guilabel:`in` The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.

          ``login`` str
          :guilabel:`in` The id3 account login.

          ``password`` str
          :guilabel:`in` The id3 account password.

          ``product_reference`` str
          :guilabel:`in` The requested product reference.

          ``commentary`` str
          :guilabel:`in` Commentary associated to this license activation.

          ``path`` str
          :guilabel:`in` Path to the retrieved license file.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        static void activate(String? hardwareCode, String? login, String? password, String? productReference, String? commentary, String? path)

      **Parameters**

        .. line-block::

          ``hardwareCode`` String
          :guilabel:`in` The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.

          ``login`` String
          :guilabel:`in` The id3 account login.

          ``password`` String
          :guilabel:`in` The id3 account password.

          ``productReference`` String
          :guilabel:`in` The requested product reference.

          ``commentary`` String
          :guilabel:`in` Commentary associated to this license activation.

          ``path`` String
          :guilabel:`in` Path to the retrieved license file.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public static void Activate(string hardwareCode, string login, string password, string productReference, string commentary, string path)

      **Parameters**

        .. line-block::

          ``hardwareCode`` string
          :guilabel:`in` The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.

          ``login`` string
          :guilabel:`in` The id3 account login.

          ``password`` string
          :guilabel:`in` The id3 account password.

          ``productReference`` string
          :guilabel:`in` The requested product reference.

          ``commentary`` string
          :guilabel:`in` Commentary associated to this license activation.

          ``path`` string
          :guilabel:`in` Path to the retrieved license file.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public static void activate(String hardwareCode, String login, String password, String productReference, String commentary, String path) throws DocumentException

      **Parameters**

        .. line-block::

          ``hardwareCode`` String
          :guilabel:`in` The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.

          ``login`` String
          :guilabel:`in` The id3 account login.

          ``password`` String
          :guilabel:`in` The id3 account password.

          ``productReference`` String
          :guilabel:`in` The requested product reference.

          ``commentary`` String
          :guilabel:`in` Commentary associated to this license activation.

          ``path`` String
          :guilabel:`in` Path to the retrieved license file.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public static func activate(hardwareCode: String, login: String, password: String, productReference: String, commentary: String, path: String) throws

      **Parameters**

        .. line-block::

          ``hardwareCode`` String
          :guilabel:`in` The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.

          ``login`` String
          :guilabel:`in` The id3 account login.

          ``password`` String
          :guilabel:`in` The id3 account password.

          ``productReference`` String
          :guilabel:`in` The requested product reference.

          ``commentary`` String
          :guilabel:`in` Commentary associated to this license activation.

          ``path`` String
          :guilabel:`in` Path to the retrieved license file.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3DocumentLicense_Activate (
            const char * hardwareCode, 
            const char * login, 
            const char * password, 
            const char * productReference, 
            const char * commentary, 
            const char * path)

      **Parameters**

        .. line-block::

          ``hardwareCode`` const char *
          :guilabel:`in` The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.

          ``login`` const char *
          :guilabel:`in` The id3 account login.

          ``password`` const char *
          :guilabel:`in` The id3 account password.

          ``productReference`` const char *
          :guilabel:`in` The requested product reference.

          ``commentary`` const char *
          :guilabel:`in` Commentary associated to this license activation.

          ``path`` const char *
          :guilabel:`in` Path to the retrieved license file.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3DocumentError<id3_document_document_error_enum>` file for the list of possible error codes.


