Guide
Skip to the Full Code section if you don’t want the step-by-step guide. In this example, we’ll automate creating Jira Connectors for a selection of projects. You will need an API key that can manage connectors. Its service account must be in the Admin group, or in a group granting Manage Connectors & Document Sets. Every request in this guide is gated onmanage:connectors.
See Understanding Permissions.
1
Prepare your request
2
Prepare your ConnectorSpecificConfig
Each Connector type has a different
ConnectorSpecificConfig. To find the correct configuration,
find your relevant Connector in
backend/onyx/connectors/.For Jira, since we’re indexing a selection of projects, rather than all projects,
we’ll need to specify jira_base_url, project_key, and optionally comment_email_blacklist.JSON
The
ConnectorSpecificConfig are the same fields you fill out in the Admin Panel when creating a Connector.3
Prepare your Connector payload
In addition to the
ConnectorSpecificConfig,
we also need to satisfy the schema for the ConnectorUpdateRequest object. See Core Concepts:
Connectors for more details.In this example, we’ll set the access_type, name, source, input_type, refresh_freq, and prune_freq.4
Make the request
5
Find your Credentials for the Connector
The easiest way to create a Credential is in the Admin Panel.
- Click Add a Connector
- Select your relevant Connector
- Follow the instructions to create a Credential
credential_id: 0 is a default empty Credential you can use for these Connectors.To list your Credentials, you can use the GET manage/admin/credential endpoint.6
Associate the Credential with the Connector
If you do not do this step, your
Connector is not fully created and you will not see it in the Admin Panel!