Run a custom extended integration locally.
Before you start
When you add the universal connector, select Local as the installation type.
Before you can retrieve an API response in Oomnitza, you must complete the following actions:
- Get your integration ID, or the ID of the integration you just created.
- Generate an Oomnitza API token.
- Download the basic integration source code and install the Python requirements.
- Add your credentials to the
config.inifile. - Upload the credentials to Oomnitza.
Retrieve your integration ID. Before you navigate away from your integration, copy your integration ID. The Integration ID is displayed in the sidebar of the integration overview page.
Generate an API token. See Adding, revoking, and refreshing an Oomnitza API token.
Download and install the basic integration. You can download the basic integration source code on the Oomnitza Connector page on GitHub. If you have already set up a basic integration, skip to Edit the configuration file.
Procedure
- Download the source code and place it in a directory, such as
C:\oomnitza_connector - In the same directory:
- Install the required Python dependencies stored in the requirements.txt file using
pip install -r requirements.txt - Run
python connector.py generate-inito generate theconfig.inifile. For further information read the Connector Configs section in the Getting started document.
- Install the required Python dependencies stored in the requirements.txt file using
Best practice
Run the Oomnitza integration in a Docker container so that you can enjoy a consistent and reproducible environment for running your Python applications. Docker containers provide isolation, portability, and scalability, making it easy to deploy the integration to different environments and handle changes in demand. Plus, running the integration in a container is a secure way to run your code, ensuring that it is not affected by the host system.
Edit the configuration file. Add or update the following information in your config.inifile.
[oomnitza]
url= https://<name_of_instance>.oomnitza.com
api token = <my_Oomnitza_token>
[managed.IntegrationID]
saas_authorization = {"headers": { "Authorization": "Bearer APIKey"}}
is_custom = trueThe IntegrationID should be replaced with the ID you retrieved.
For SaaS Authorization, you can only supply basic, session-based, or API key authentication.
Example of basic authentication
[oomnitza]
url= https://<name_of_instance>.oomnitza.com
api token = <my_Oomnitza_token>
[managed.IntegrationID]
saas_authorization = {"headers": {"Authorization": "Basic username:password"}}
is_custom = trueExample of session-based authentication
[oomnitza]
url = https://example.oomnitza.com
api_token = i_am_oomnitza_api_token_1
[managed.IntegrationID]
local_inputs = {"username": "john.smith", "password": "supErs3cr3T"}
is_custom = trueImportant
You cannot use your AWS or OAuth credentials in managed mode. To use these authentication methods, you must select Cloud as the installation type when creating an extended integration.
4. Upload the integration information
To upload the integration information to Oomnitza, run the connector.py file.
python connector.pyProcedure
To retrieve the API response:
- Select Test Run from the sidebar.
- A JSON file will be stored in the
C:\oomnitza_connector\save_datadirectory. - Copy the JSON file's content and then click PASTE FROM CLIPBOARD located in Oomnitza's integration response section.
Comments
0 comments
Please sign in to leave a comment.