Skip to content

Latest commit

 

History

History
312 lines (219 loc) · 15.5 KB

File metadata and controls

312 lines (219 loc) · 15.5 KB

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

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

ProxyGetProxyRequest req = new ProxyGetProxyRequest() {
    ServiceId = "close",
    UnifiedApi = "hris",
    DownstreamUrl = "https://api.close.com/api/v1/lead",
    DownstreamAuthorization = "Bearer <token>",
    Timeout = 30000,
};

var res = await sdk.Proxy.GetAsync(req);

// handle response

Parameters

Parameter Type Required Description
request ProxyGetProxyRequest ✔️ The request object to use for the request.

Response

ProxyGetProxyResponse

Errors

Error Type Status Code Content Type
ApideckUnifySdk.Models.Errors.Unauthorized 401 application/json
ApideckUnifySdk.Models.Errors.APIException 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

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

ProxyOptionsProxyRequest req = new ProxyOptionsProxyRequest() {
    ServiceId = "close",
    UnifiedApi = "hris",
    DownstreamUrl = "https://api.close.com/api/v1/lead",
    DownstreamAuthorization = "Bearer <token>",
    Timeout = 30000,
};

var res = await sdk.Proxy.OptionsAsync(req);

// handle response

Parameters

Parameter Type Required Description
request ProxyOptionsProxyRequest ✔️ The request object to use for the request.

Response

ProxyOptionsProxyResponse

Errors

Error Type Status Code Content Type
ApideckUnifySdk.Models.Errors.Unauthorized 401 application/json
ApideckUnifySdk.Models.Errors.APIException 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

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

ProxyPostProxyRequest req = new ProxyPostProxyRequest() {
    ServiceId = "close",
    UnifiedApi = "hris",
    DownstreamUrl = "https://api.close.com/api/v1/lead",
    DownstreamAuthorization = "Bearer <token>",
    Timeout = 30000,
};

var res = await sdk.Proxy.PostAsync(req);

// handle response

Parameters

Parameter Type Required Description
request ProxyPostProxyRequest ✔️ The request object to use for the request.

Response

ProxyPostProxyResponse

Errors

Error Type Status Code Content Type
ApideckUnifySdk.Models.Errors.Unauthorized 401 application/json
ApideckUnifySdk.Models.Errors.APIException 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

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

ProxyPutProxyRequest req = new ProxyPutProxyRequest() {
    ServiceId = "close",
    UnifiedApi = "hris",
    DownstreamUrl = "https://api.close.com/api/v1/lead",
    DownstreamAuthorization = "Bearer <token>",
    Timeout = 30000,
};

var res = await sdk.Proxy.PutAsync(req);

// handle response

Parameters

Parameter Type Required Description
request ProxyPutProxyRequest ✔️ The request object to use for the request.

Response

ProxyPutProxyResponse

Errors

Error Type Status Code Content Type
ApideckUnifySdk.Models.Errors.Unauthorized 401 application/json
ApideckUnifySdk.Models.Errors.APIException 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

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

ProxyPatchProxyRequest req = new ProxyPatchProxyRequest() {
    ServiceId = "close",
    UnifiedApi = "hris",
    DownstreamUrl = "https://api.close.com/api/v1/lead",
    DownstreamAuthorization = "Bearer <token>",
    Timeout = 30000,
};

var res = await sdk.Proxy.PatchAsync(req);

// handle response

Parameters

Parameter Type Required Description
request ProxyPatchProxyRequest ✔️ The request object to use for the request.

Response

ProxyPatchProxyResponse

Errors

Error Type Status Code Content Type
ApideckUnifySdk.Models.Errors.Unauthorized 401 application/json
ApideckUnifySdk.Models.Errors.APIException 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

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

ProxyDeleteProxyRequest req = new ProxyDeleteProxyRequest() {
    ServiceId = "close",
    UnifiedApi = "hris",
    DownstreamUrl = "https://api.close.com/api/v1/lead",
    DownstreamAuthorization = "Bearer <token>",
    Timeout = 30000,
};

var res = await sdk.Proxy.DeleteAsync(req);

// handle response

Parameters

Parameter Type Required Description
request ProxyDeleteProxyRequest ✔️ The request object to use for the request.

Response

ProxyDeleteProxyResponse

Errors

Error Type Status Code Content Type
ApideckUnifySdk.Models.Errors.Unauthorized 401 application/json
ApideckUnifySdk.Models.Errors.APIException 4XX, 5XX */*