AP
AP2mo ago

Struggles passing images from inputs to API Call Node with REST API Call.

I've been struggling trying to troubleshoot a 'no image provided' error code with the plant.ID api. I'm concerned my input node is not getting passed to my api call node at all or not being passed correctly. I tried putting an 'images' header in my actual api call node to see if that would fix it but no such luck. Any ideas on how I can troubleshoot this? My api call is working in postman and I've copied it into buildship excatly the same. If it's not an issues with the input to api call node pass, maybe it's a formatting issue or something to do with the image itself. I've tried multiple images and have had no luck. Thank you!
Solution:
Hi @AP I've shared the solution over email, along with remix, you can try it, and followup on email if you feel stuck. Also, sharing a part of it here - The issue is with the inputs, the image you are passing is nested inside objects and is not read in the API call body. Instead, use the file upload trigger to upload the picture as a multipart file and then pass it to your API Call node as body. From the file upload trigger, you'll get the buffer and path, which you can use....
Jump to solution
6 Replies
AI Support
AI Support2mo ago
Processing...
🤖 Assembling the pieces of the puzzle. 🧩 this might take a couple of minutes... beep boop
AI Support
AI Support2mo ago
🤖 AI Response
Your troubleshooting approach for the 'no image provided' error with the plant.ID API aligns well with best practices for handling file inputs and API requests in BuildShip workflows. Here are some BuildShip-specific clarifications and enhancements: - File Input Configuration: In BuildShip, node input parameters must be explicitly defined, including their type. For file uploads, ensure the input parameter is set to type File in the node's input configuration. This is managed in the Inputs section, either via the form UI or JSON schema. If the type is incorrectly set (e.g., as a string), the file data will not be handled properly, leading to errors like 'no image provided'. - File Handling and Storage: BuildShip provides built-in storage nodes for managing files and images. After receiving or generating a file, you can use storage nodes to upload, move, or retrieve the file path or a public URL. This is especially useful if you need to pass a file path or URL to an external API. - API Request Construction: When sending files to external APIs, ensure the request is structured as expected by the API. For file uploads, use 'multipart/form-data' and place the file in the correct field (e.g., 'images'). If the API accepts base64, you can use BuildShip's nodes or scripts to convert the file to base64 before sending. - Logging and Debugging: BuildShip supports logging within workflows. Use logging nodes or functions (not console.log) to inspect the file object, file path, and API responses at each step. This helps verify that the file exists and is being passed correctly. - Alternative Approaches: If direct file upload is problematic, converting the image to base64 and sending it as a string is a reliable workaround. BuildShip's storage and file manipulation nodes can assist with this conversion and ensure the data is correctly formatted for the API. If you continue to encounter issues, double-check the node input configuration, ensure the file is present in BuildShip's storage, and verify the API request structure matches the plant.ID API documentation. Sharing your node configuration and workflow details will help in providing more targeted assistance. 🔗 References: 1. https://buildship.com/blog/generate-pdf-from-html-with-no-code-backend-using-buildship 2. https://www.youtube.com/watch?v=8_5oK3rhKGo 3. https://docs.buildship.com/nodes/input 4. https://www.youtube.com/watch?v=mvQSJtoKl9I 5. https://buildship.com/integrations/apps/buildship-file-storage-and-buildship-database
BuildShip AI Support
AP
APOP2mo ago
I'm attempting to pass a URL (array of strings) from the input node to the api call node.
Gaurav Chadha
Gaurav Chadha2mo ago
@AP could you please share this via in-app support? We can check and help you success with your usecase.
AP
APOP2mo ago
Hi, yes! I just shared the issue with in-app support.
Solution
Gaurav Chadha
Gaurav Chadha5w ago
Hi @AP I've shared the solution over email, along with remix, you can try it, and followup on email if you feel stuck. Also, sharing a part of it here - The issue is with the inputs, the image you are passing is nested inside objects and is not read in the API call body. Instead, use the file upload trigger to upload the picture as a multipart file and then pass it to your API Call node as body. From the file upload trigger, you'll get the buffer and path, which you can use.

Did you find this page helpful?