(fileStorage.files)
- list - List Files
- search - Search Files
- get - Get File
- update - Rename or move File
- delete - Delete File
- download - Download File
- export - Export File
List Files
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.fileStorage.files.list({
serviceId: "salesforce",
filter: {
driveId: "1234",
folderId: "root",
shared: true,
},
sort: {
by: "updated_at",
direction: "desc",
},
passThrough: {
"search": "San Francisco",
},
fields: "id,updated_at",
});
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { fileStorageFilesList } from "@apideck/unify/funcs/fileStorageFilesList.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await fileStorageFilesList(apideck, {
serviceId: "salesforce",
filter: {
driveId: "1234",
folderId: "root",
shared: true,
},
sort: {
by: "updated_at",
direction: "desc",
},
passThrough: {
"search": "San Francisco",
},
fields: "id,updated_at",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FileStorageFilesAllRequest | ✔️ | 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.FileStorageFilesAllResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |
Search Files
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.fileStorage.files.search({
serviceId: "salesforce",
passThrough: {
"search": "San Francisco",
},
fields: "id,updated_at",
filter: {
driveId: "1234",
folderId: "root",
shared: true,
},
filesSearch: {
query: "logo jpg",
driveId: "1234",
passThrough: [
{
serviceId: "<id>",
extendPaths: [
{
path: "$.nested.property",
value: {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
],
},
],
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { fileStorageFilesSearch } from "@apideck/unify/funcs/fileStorageFilesSearch.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await fileStorageFilesSearch(apideck, {
serviceId: "salesforce",
passThrough: {
"search": "San Francisco",
},
fields: "id,updated_at",
filter: {
driveId: "1234",
folderId: "root",
shared: true,
},
filesSearch: {
query: "logo jpg",
driveId: "1234",
passThrough: [
{
serviceId: "<id>",
extendPaths: [
{
path: "$.nested.property",
value: {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
],
},
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FileStorageFilesSearchRequest | ✔️ | 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.FileStorageFilesSearchResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |
Get File
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.fileStorage.files.get({
id: "<id>",
serviceId: "salesforce",
fields: "id,updated_at",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { fileStorageFilesGet } from "@apideck/unify/funcs/fileStorageFilesGet.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await fileStorageFilesGet(apideck, {
id: "<id>",
serviceId: "salesforce",
fields: "id,updated_at",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FileStorageFilesOneRequest | ✔️ | 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.FileStorageFilesOneResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |
Rename or move File
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.fileStorage.files.update({
id: "<id>",
serviceId: "salesforce",
updateFileRequest: {
name: "New Name.pdf",
description: "Renamed PDF Document",
parentFolderId: "1234",
passThrough: [
{
serviceId: "<id>",
extendPaths: [
{
path: "$.nested.property",
value: {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
],
},
],
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { fileStorageFilesUpdate } from "@apideck/unify/funcs/fileStorageFilesUpdate.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await fileStorageFilesUpdate(apideck, {
id: "<id>",
serviceId: "salesforce",
updateFileRequest: {
name: "New Name.pdf",
description: "Renamed PDF Document",
parentFolderId: "1234",
passThrough: [
{
serviceId: "<id>",
extendPaths: [
{
path: "$.nested.property",
value: {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
],
},
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FileStorageFilesUpdateRequest | ✔️ | 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.FileStorageFilesUpdateResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |
Delete File
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.fileStorage.files.delete({
id: "<id>",
serviceId: "salesforce",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { fileStorageFilesDelete } from "@apideck/unify/funcs/fileStorageFilesDelete.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await fileStorageFilesDelete(apideck, {
id: "<id>",
serviceId: "salesforce",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FileStorageFilesDeleteRequest | ✔️ | 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.FileStorageFilesDeleteResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |
Download File
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.fileStorage.files.download({
id: "<id>",
serviceId: "salesforce",
fields: "id,updated_at",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { fileStorageFilesDownload } from "@apideck/unify/funcs/fileStorageFilesDownload.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await fileStorageFilesDownload(apideck, {
id: "<id>",
serviceId: "salesforce",
fields: "id,updated_at",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FileStorageFilesDownloadRequest | ✔️ | 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.FileStorageFilesDownloadResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |
Export File
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.fileStorage.files.export({
id: "<id>",
serviceId: "salesforce",
fields: "id,updated_at",
format: "pdf",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { fileStorageFilesExport } from "@apideck/unify/funcs/fileStorageFilesExport.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await fileStorageFilesExport(apideck, {
id: "<id>",
serviceId: "salesforce",
fields: "id,updated_at",
format: "pdf",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FileStorageFilesExportRequest | ✔️ | 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.FileStorageFilesExportResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |