Yes, you can use the encodeURIComponent function to encode Hebrew letters or any other special characters in a URL. Here’s an example using Pipedream component code: export default defineComponent({ props: { tableName: { type: "string", label: "Table Name", }, }, async run({ steps, $ }) { const encodedTableName = encodeURIComponent(this.tableName); const url = `https://cloud.seatable.io/api/v2.1/workspace/27663/dtable/${encodedTableName}/access-token`; // You can now use the encoded URL in your request }, }); Replace {table_name} with the encodedTableName variable in your URL. This will ensure the Hebrew letters are properly encoded and can be used in the API request.
Sure, I can add an export to the example code I provided earlier. Here’s the updated code with an export for the encoded table name: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { tableName: { type: "string", label: "Table Name", }, }, async run({ steps, $ }) { const encodedTableName = encodeURIComponent(this.tableName); const url = `https://cloud.seatable.io/api/v2.1/workspace/27663/dtable/${encodedTableName}/access-token`; // Export the encoded table name $.export("encodedTableName", encodedTableName); // You can now use the encoded URL in your request }, }); Now, the encoded table name will be exported and can be accessed in the next steps using steps.<step_name>.encodedTableName, where <step_name> should be replaced with the name of this step in your workflow.
To make a URL call to the Seatable API with authentication, you’ll need an API key. You can use the axios from the @pipedream/platform package to make the request. Here’s an example Pipedream component code: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { tableName: { type: "string", label: "Table Name", }, apiKey: { type: "string", label: "API Key", secret: true, }, }, async run({ steps, $ }) { const encodedTableName = encodeURIComponent(this.tableName); const url = `https://cloud.seatable.io/api/v2.1/workspace/27663/dtable/${encodedTableName}/access-token`; const response = await axios(this, { method: "GET", url: url, headers: { Authorization: `Token ${this.apiKey}`, }, }); return response; }, }); Replace {table_name} with the encodedTableName variable in the URL. This will ensure the Hebrew letters or any other special characters are properly encoded and can be used in the API request. The apiKey prop should be filled with your Seatable API key.
To make an HTTP request using the axios module with the headers you provided and using the account token from another step, you can follow this example: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { url: { type: "string", label: "URL", }, accountToken: { type: "string", label: "Account Token", }, }, async run({ steps, $ }) { const response = await axios(this, { method: "GET", url: this.url, headers: { accept: "application/json", authorization: `Bearer ${this.accountToken}`, }, }); return response; }, }); Replace this.url with the URL you want to call, and this.accountToken with the account token from the previous step. This example makes a GET request, but you can change the method to POST, PUT, or any other HTTP method as needed.