Create Connector
POST/v1/connector/create_connector/:workspace_id
Create Connector
Creates a new connector in a workspace. To associate this connector to collections, use the create_connector_collection_association post
Args
- connector_repository (ConnectorRepository): The repository for managing connectors.
- workspace_id (str): The workspace_id of the connector to be created.
- user (TokenData): The token data of the authenticated user.
- scheduler_type (AllowedSchedulerTypes): the type of the scheduler. Allowed values: "imed", "cron" and "when".
- scheduler_value (str|None): time value for type=="cron" or date for type=="when"
- connector_info (BaseConnectorRequestBody): The information of the connector to be created
Request Body:
{
"id": "string", # Optional, default to None -> uuid is generated
"name": "string",
"credentials": {}, # Optional, default to {}
"slots": {CHECK REQUIRED SLOTS},
"type": "string" # allowed types: "google_drive", "impersonated_google_drive", "web_scraper", "upload", "confluence", "jira", "sharepoint" or "onedrive"
}
Required Slots based on type:
google_drive and impersonated_google_drive
{
"root_file_id": "id or URL of a google drive file or folder",
"root_item_ids": ["list of root_item_id or root_item_url"]
}
web_scraper
{
"url" : "url to be extracted",
"extraction_type" : "string", # "single" or "all". Single extracts only the specified page. All extracts all pages related to the specified page
"email": "user email" # the user will be the file_owner of the files
}
confluence
{
"base_url": "https://aumo.atlassian.net",
"cql_query": "string do query do CQL",
"config": {
"include_attachments": bool,
"search_children": bool,
"search_folders": bool
},
"spaces": ["lista de string", "upload de todas as pags do space"],
"pages": ["lista de string", "link de páginas", "sem os filhos"],
"pages_w_child": ["link de páginas", "tbm faz upload dos filhos"],
"folders": ["upload de todas as pags da pasta"],
"upload_all_data": bool
}
jira
{
"base_url": "https://aumo.atlassian.net",
"jql_query": "string do query do JQL",
"config": {
"include_attachments": bool,
"search_children_issues": bool,
"search_parent_issues": bool
}
}
sharepoint
{
"urls": [
"sharepoint_url_01",
"sharepoint_url_02",
]
}
onedrive
{
"urls": [
"onedrive_url_01",
"onedrive_url_02"
]
}
Returns:
ConnectorModelReponse : the information of the connector just created, with the id generated for it
Important observations:
About connector type and slots:
- if type == google_drive, slots MUST contain "root_file_id"
- you can put the entire URL in the "root_file_id", and the route will extract the id from it
- if type == impersonated_google_drive, slots MUST contain "root_file_id" and "target_account"
- if this isn't followed, this API will return an HTTP Exception
- although these parameters are required, you can add more parameters if needed
About the scheduler:
- when a connector is created, the scheduler is created
- if the creation of the connector fails, the scheduler is not created
- if the creation of the scheduler fails, the connector that has just been created is deleted
- if scheduler_type == imed, scheduler_value is not required
- if scheduler_type == imed, the scheduler is not created. It waits for a connection to be made (with a collection)
Request
Responses
- 201
- 400
- 401
- 403
- 404
- default
Successful Response
Bad Request
Unauthorized
Forbidden
Not Found
Other client error