Connector Providers
Connector Providers
Connector Providers in the FastAPI platform facilitate integration with various external services. They act as intermediaries that allow your application to interact with third-party systems seamlessly. Managing these connectors effectively is crucial for ensuring smooth data flow and interoperability between your application and external services.
Key Concepts
- Connector Provider: An entity that represents a connection to an external service. Each provider has a unique identifier, known as
provider_slug, which is used to reference it in API calls. - Setup: The process of configuring a connector provider to establish a connection with the external service. This setup typically involves providing necessary credentials and configuration details.
- Reset: The action of removing or clearing the setup configuration of a connector provider, effectively disconnecting it from the external service.
Common Workflows
Listing Connector Providers
To retrieve a list of all available connector providers, use the following endpoint:
curl -X GET "https://api.example.com/v1/admin/connector-providers" -H "X-API-Key: your_api_key"This call returns a list of all connector providers available in your system, allowing you to identify which services can be integrated.
Getting a Specific Connector Provider
To obtain details about a specific connector provider, use the provider_slug to make the following request:
curl -X GET "https://api.example.com/v1/admin/connector-providers/{provider_slug}" -H "X-API-Key: your_api_key"Replace {provider_slug} with the actual slug of the provider you are interested in. This call provides detailed information about the specified provider, which is useful for understanding its capabilities and requirements.
Setting Up a Connector Provider
To configure a connector provider, send a POST request with the necessary setup details:
curl -X POST "https://api.example.com/v1/admin/connector-providers/{provider_slug}/setup" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"config_key": "config_value"
}'This request body should include all required configuration parameters specific to the provider. Successful setup enables your application to interact with the external service.
Resetting a Connector Provider
If you need to disconnect a provider or clear its configuration, use the DELETE method:
curl -X DELETE "https://api.example.com/v1/admin/connector-providers/{provider_slug}/setup" -H "X-API-Key: your_api_key"This operation removes the setup configuration, effectively disabling the connection to the external service.
Important Considerations
- Authentication: While the
X-API-Keyheader is optional, it is strongly recommended to include it in your requests to ensure secure access to the API. - Error Handling: Always check the response status codes and handle errors appropriately. A 200 status code indicates a successful operation, while other codes may require different handling strategies.
- Data Security: Ensure that sensitive information, such as API keys and configuration details, is handled securely and not exposed in logs or error messages.
By understanding and utilizing these endpoints effectively, you can manage connector providers efficiently, enabling robust integrations with external services.