Is There an API Endpoint for a Filestore and What is Its URL?

This topic was automatically generated from Slack. You can find the original thread here.

Is there an API endpoint for a filestore. If yes, then what is the URL for it?

Currently, there is no specific API endpoint for File Stores mentioned in the Pipedream documentation. File Stores are accessible through the Pipedream Dashboard for Advanced plan and above subscribed workspaces. You can manage File Stores by opening the Project and selecting the File Store on the left-hand navigation menu. For more details, you can visit the File Stores documentation. If you have further questions or need additional support, please visit Pipedream Support.

How can I access the file from the filestore within my workflow using API?

There’s no HTTP API, but you can access the files in file store within a Node.js code step

How can I access the file from the filestore within my workflow?

To access files from the File Store within your workflow, you can use the $.files helper in Node.js code steps. Here’s a brief guide on how to do it: 1. Ensure your workflow is within the same project: File Stores are scoped to projects, meaning only workflows within the same project can access the files. 2. Use the $.files helper: You can access files programmatically using the $.files helper within Node.js code steps. Here’s an example of how you might use it: export default defineComponent({ async run({ steps, $ }) { // Replace 'your-file-key' with the key of the file you want to access const file = await $.files.get('your-file-key'); // Do something with the file, e.g., log its contents console.log(file); }, }); This code snippet demonstrates how to retrieve a file from the File Store using its key and then log its contents. Make sure to replace 'your-file-key' with the actual key of the file you want to access. For more details, you can refer to the Pipedream File Stores documentation.

there’s no $.files.get() in the documentation, what is the correct approach?

Anyway , here’s the file stores docs: GitHub

To interact with files in Pipedream’s File Store, you should use the $.files helper. Although there is no $.files.get() method, you can use the $.files.dir() method to list files and directories, and then open files using $.files.open(). Here’s an example of how to list and open files in the File Store: export default defineComponent({ async run({ steps, $ }) { // List all contents of the root File Stores directory in this project const dirs = $.files.dir(); let files = []; for await (const dir of dirs) { // If this is a file, let's open it if (dir.isFile()) { files.push(await $.files.open(dir.path)); } } return files; }, }) In this example, $.files.dir() lists all files and directories at the root of the File Store. For each file, $.files.open(dir.path) is used to open the file. This approach allows you to access and manipulate files stored in Pipedream’s File Store. For more details, you can refer to the Pipedream File Store documentation.

thanks for the URL… Is there directly an endpoint that I can use within my API if not using nodejs?

No, only supported in Node.js currently