Skip to content

Latest commit

 

History

History
283 lines (249 loc) · 19.1 KB

README.md

File metadata and controls

283 lines (249 loc) · 19.1 KB

ConnectionSettings

(vault.connection_settings)

Overview

Available Operations

  • list - Get resource settings
  • update - Update settings

list

This endpoint returns custom settings and their defaults required by connection for a given resource.

Example Usage

from apideck_unify import Apideck
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.vault.connection_settings.list(unified_api="crm", service_id="pipedrive", resource="leads", consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")

    assert res.get_connection_response is not None

    # Handle response
    print(res.get_connection_response)

Parameters

Parameter Type Required Description Example
unified_api str ✔️ Unified API crm
service_id str ✔️ Service ID of the resource to return pipedrive
resource str ✔️ Name of the resource (plural) leads
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.VaultConnectionSettingsAllResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

update

Update default values for a connection's resource settings

Example Usage

from apideck_unify import Apideck
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.vault.connection_settings.update(service_id="pipedrive", unified_api="crm", resource="leads", consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", enabled=True, settings={
        "instance_url": "https://eu28.salesforce.com",
        "api_key": "12345xxxxxx",
    }, metadata={
        "account": {
            "name": "My Company",
            "id": "c01458a5-7276-41ce-bc19-639906b0450a",
        },
        "plan": "enterprise",
    }, configuration=[
        {
            "resource": "leads",
            "defaults": [
                {
                    "id": "ProductInterest",
                    "options": [
                        {
                            "id": "1234",
                            "label": "General Channel",
                            "options": [
                                {
                                    "label": "General Channel",
                                    "value": 12.5,
                                },
                                {
                                    "label": "General Channel",
                                    "value": [
                                        "team",
                                        "general",
                                    ],
                                },
                            ],
                        },
                        {
                            "label": "General Channel",
                            "value": [
                                "team",
                                "general",
                            ],
                        },
                    ],
                    "value": 10.5,
                },
                {
                    "id": "ProductInterest",
                    "options": [
                        {
                            "label": "General Channel",
                            "value": "general",
                        },
                    ],
                    "value": True,
                },
            ],
        },
        {
            "resource": "leads",
            "defaults": [
                {
                    "id": "ProductInterest",
                    "options": [
                        {
                            "label": "General Channel",
                            "value": True,
                        },
                    ],
                    "value": True,
                },
                {
                    "id": "ProductInterest",
                    "options": [
                        {
                            "label": "General Channel",
                            "value": True,
                        },
                        {
                            "id": "1234",
                            "label": "General Channel",
                            "options": [
                                {
                                    "label": "General Channel",
                                    "value": 12.5,
                                },
                                {
                                    "label": "General Channel",
                                    "value": "general",
                                },
                            ],
                        },
                    ],
                    "value": 10,
                },
                {
                    "id": "ProductInterest",
                    "options": [
                        {
                            "id": "1234",
                            "label": "General Channel",
                            "options": [
                                {
                                    "label": "General Channel",
                                    "value": [
                                        "team",
                                        "general",
                                    ],
                                },
                                {
                                    "label": "General Channel",
                                    "value": True,
                                },
                                {
                                    "label": "General Channel",
                                    "value": 12.5,
                                },
                            ],
                        },
                        {
                            "label": "General Channel",
                            "value": 12.5,
                        },
                    ],
                    "value": 10.5,
                },
            ],
        },
        {
            "resource": "leads",
            "defaults": [
                {
                    "id": "ProductInterest",
                    "options": [
                        {
                            "label": "General Channel",
                            "value": "general",
                        },
                        {
                            "label": "General Channel",
                            "value": True,
                        },
                        {
                            "label": "General Channel",
                            "value": True,
                        },
                    ],
                    "value": "GC5000 series",
                },
                {
                    "id": "ProductInterest",
                    "options": [
                        {
                            "label": "General Channel",
                            "value": True,
                        },
                        {
                            "label": "General Channel",
                            "value": 123,
                        },
                    ],
                    "value": 10.5,
                },
            ],
        },
    ], custom_mappings=[
        {
            "value": "$.root.training.first_aid",
        },
    ])

    assert res.update_connection_response is not None

    # Handle response
    print(res.update_connection_response)

Parameters

Parameter Type Required Description Example
service_id str ✔️ Service ID of the resource to return pipedrive
unified_api str ✔️ Unified API crm
resource str ✔️ Name of the resource (plural) leads
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
enabled Optional[bool] Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. true
settings Dict[str, Any] Connection settings. Values will persist to form_fields with corresponding id {
"instance_url": "https://eu28.salesforce.com",
"api_key": "12345xxxxxx"
}
metadata Dict[str, Any] Attach your own consumer specific metadata {
"account": {
"name": "My Company",
"id": "c01458a5-7276-41ce-bc19-639906b0450a"
},
"plan": "enterprise"
}
configuration List[models.ConnectionConfiguration] N/A
custom_mappings List[models.CustomMappingInput] List of custom mappings configured for this connection
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.VaultConnectionSettingsUpdateResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*