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.
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const result = await apideck.proxy.get({
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
console.log(result);
}
run();The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { proxyGet } from "@apideck/unify/funcs/proxyGet.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const res = await proxyGet(apideck, {
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("proxyGet failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ProxyGetProxyRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ProxyGetProxyResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.Unauthorized | 401 | application/json |
| errors.APIError | 4XX, 5XX | */* |
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.
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const result = await apideck.proxy.options({
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
console.log(result);
}
run();The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { proxyOptions } from "@apideck/unify/funcs/proxyOptions.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const res = await proxyOptions(apideck, {
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("proxyOptions failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ProxyOptionsProxyRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ProxyOptionsProxyResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.Unauthorized | 401 | application/json |
| errors.APIError | 4XX, 5XX | */* |
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.
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const result = await apideck.proxy.post({
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
console.log(result);
}
run();The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { proxyPost } from "@apideck/unify/funcs/proxyPost.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const res = await proxyPost(apideck, {
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("proxyPost failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ProxyPostProxyRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ProxyPostProxyResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.Unauthorized | 401 | application/json |
| errors.APIError | 4XX, 5XX | */* |
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.
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const result = await apideck.proxy.put({
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
console.log(result);
}
run();The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { proxyPut } from "@apideck/unify/funcs/proxyPut.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const res = await proxyPut(apideck, {
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("proxyPut failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ProxyPutProxyRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ProxyPutProxyResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.Unauthorized | 401 | application/json |
| errors.APIError | 4XX, 5XX | */* |
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.
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const result = await apideck.proxy.patch({
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
console.log(result);
}
run();The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { proxyPatch } from "@apideck/unify/funcs/proxyPatch.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const res = await proxyPatch(apideck, {
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("proxyPatch failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ProxyPatchProxyRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ProxyPatchProxyResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.Unauthorized | 401 | application/json |
| errors.APIError | 4XX, 5XX | */* |
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.
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const result = await apideck.proxy.delete({
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
console.log(result);
}
run();The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { proxyDelete } from "@apideck/unify/funcs/proxyDelete.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const res = await proxyDelete(apideck, {
serviceId: "close",
unifiedApi: "hris",
downstreamUrl: "https://api.close.com/api/v1/lead",
downstreamAuthorization: "Bearer <token>",
timeout: 30000,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("proxyDelete failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ProxyDeleteProxyRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ProxyDeleteProxyResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.Unauthorized | 401 | application/json |
| errors.APIError | 4XX, 5XX | */* |