Skip to content

Latest commit

 

History

History
334 lines (229 loc) · 56.2 KB

File metadata and controls

334 lines (229 loc) · 56.2 KB

Proxy

(proxy)

Overview

Available Operations

get

Proxies a downstream GET request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. Note: Vault will proxy all data to the downstream URL and method/verb in the headers.

Example Usage

from apideck_unify import Apideck
import os


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

    res = apideck.proxy.get(service_id="close", downstream_url="https://api.close.com/api/v1/lead", unified_api="hris", downstream_authorization="Bearer <token>", timeout=30000)

    assert res.response_json is not None

    # Handle response
    print(res.response_json)

Parameters

Parameter Type Required Description Example
service_id str ✔️ Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. close
downstream_url str ✔️ Downstream URL https://api.close.com/api/v1/lead
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
unified_api Optional[str] Specify which unified API to use for the connection lookup. Required for multi-API connectors (e.g., Workday) to ensure the correct credentials are used. hris
downstream_authorization Optional[str] Downstream authorization header. This will skip the Vault token injection. Bearer
timeout Optional[int] Override the default downstream request timeout in milliseconds. The default is 28000 (28 seconds). 30000
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ProxyGetProxyResponse

Errors

Error Type Status Code Content Type
models.Unauthorized 401 application/json
models.APIError 4XX, 5XX */*

options

Proxies a downstream OPTION request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. Note: Vault will proxy all data to the downstream URL and method/verb in the headers.

Example Usage

from apideck_unify import Apideck
import os


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

    res = apideck.proxy.options(service_id="close", downstream_url="https://api.close.com/api/v1/lead", unified_api="hris", downstream_authorization="Bearer <token>", timeout=30000)

    assert res.response_json is not None

    # Handle response
    print(res.response_json)

Parameters

Parameter Type Required Description Example
service_id str ✔️ Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. close
downstream_url str ✔️ Downstream URL https://api.close.com/api/v1/lead
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
unified_api Optional[str] Specify which unified API to use for the connection lookup. Required for multi-API connectors (e.g., Workday) to ensure the correct credentials are used. hris
downstream_authorization Optional[str] Downstream authorization header. This will skip the Vault token injection. Bearer
timeout Optional[int] Override the default downstream request timeout in milliseconds. The default is 28000 (28 seconds). 30000
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ProxyOptionsProxyResponse

Errors

Error Type Status Code Content Type
models.Unauthorized 401 application/json
models.APIError 4XX, 5XX */*

post

Proxies a downstream POST request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. Note: Vault will proxy all data to the downstream URL and method/verb in the headers.

Example Usage

from apideck_unify import Apideck
import os


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

    res = apideck.proxy.post(service_id="close", downstream_url="https://api.close.com/api/v1/lead", unified_api="hris", downstream_authorization="Bearer <token>", timeout=30000)

    assert res.response_json is not None

    # Handle response
    print(res.response_json)

Parameters

Parameter Type Required Description Example
service_id str ✔️ Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. close
downstream_url str ✔️ Downstream URL https://api.close.com/api/v1/lead
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
unified_api Optional[str] Specify which unified API to use for the connection lookup. Required for multi-API connectors (e.g., Workday) to ensure the correct credentials are used. hris
downstream_authorization Optional[str] Downstream authorization header. This will skip the Vault token injection. Bearer
timeout Optional[int] Override the default downstream request timeout in milliseconds. The default is 28000 (28 seconds). 30000
request_body Optional[Union[bytes, IO[bytes], io.BufferedReader]] Depending on the verb/method of the request this will contain the request body you want to POST/PATCH/PUT.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ProxyPostProxyResponse

Errors

Error Type Status Code Content Type
models.Unauthorized 401 application/json
models.APIError 4XX, 5XX */*

put

Proxies a downstream PUT request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. Note: Vault will proxy all data to the downstream URL and method/verb in the headers.

Example Usage

from apideck_unify import Apideck
import os


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

    res = apideck.proxy.put(service_id="close", downstream_url="https://api.close.com/api/v1/lead", unified_api="hris", downstream_authorization="Bearer <token>", timeout=30000)

    assert res.response_json is not None

    # Handle response
    print(res.response_json)

Parameters

Parameter Type Required Description Example
service_id str ✔️ Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. close
downstream_url str ✔️ Downstream URL https://api.close.com/api/v1/lead
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
unified_api Optional[str] Specify which unified API to use for the connection lookup. Required for multi-API connectors (e.g., Workday) to ensure the correct credentials are used. hris
downstream_authorization Optional[str] Downstream authorization header. This will skip the Vault token injection. Bearer
timeout Optional[int] Override the default downstream request timeout in milliseconds. The default is 28000 (28 seconds). 30000
request_body Optional[Union[bytes, IO[bytes], io.BufferedReader]] Depending on the verb/method of the request this will contain the request body you want to POST/PATCH/PUT.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ProxyPutProxyResponse

Errors

Error Type Status Code Content Type
models.Unauthorized 401 application/json
models.APIError 4XX, 5XX */*

patch

Proxies a downstream PATCH request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. Note: Vault will proxy all data to the downstream URL and method/verb in the headers.

Example Usage

from apideck_unify import Apideck
import os


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

    res = apideck.proxy.patch(service_id="close", downstream_url="https://api.close.com/api/v1/lead", unified_api="hris", downstream_authorization="Bearer <token>", timeout=30000)

    assert res.response_json is not None

    # Handle response
    print(res.response_json)

Parameters

Parameter Type Required Description Example
service_id str ✔️ Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. close
downstream_url str ✔️ Downstream URL https://api.close.com/api/v1/lead
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
unified_api Optional[str] Specify which unified API to use for the connection lookup. Required for multi-API connectors (e.g., Workday) to ensure the correct credentials are used. hris
downstream_authorization Optional[str] Downstream authorization header. This will skip the Vault token injection. Bearer
timeout Optional[int] Override the default downstream request timeout in milliseconds. The default is 28000 (28 seconds). 30000
request_body Optional[Union[bytes, IO[bytes], io.BufferedReader]] Depending on the verb/method of the request this will contain the request body you want to POST/PATCH/PUT.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ProxyPatchProxyResponse

Errors

Error Type Status Code Content Type
models.Unauthorized 401 application/json
models.APIError 4XX, 5XX */*

delete

Proxies a downstream DELETE request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. Note: Vault will proxy all data to the downstream URL and method/verb in the headers.

Example Usage

from apideck_unify import Apideck
import os


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

    res = apideck.proxy.delete(service_id="close", downstream_url="https://api.close.com/api/v1/lead", unified_api="hris", downstream_authorization="Bearer <token>", timeout=30000)

    assert res.response_json is not None

    # Handle response
    print(res.response_json)

Parameters

Parameter Type Required Description Example
service_id str ✔️ Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. close
downstream_url str ✔️ Downstream URL https://api.close.com/api/v1/lead
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
unified_api Optional[str] Specify which unified API to use for the connection lookup. Required for multi-API connectors (e.g., Workday) to ensure the correct credentials are used. hris
downstream_authorization Optional[str] Downstream authorization header. This will skip the Vault token injection. Bearer
timeout Optional[int] Override the default downstream request timeout in milliseconds. The default is 28000 (28 seconds). 30000
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ProxyDeleteProxyResponse

Errors

Error Type Status Code Content Type
models.Unauthorized 401 application/json
models.APIError 4XX, 5XX */*