Building a basic business card reader for myself to update google sheets and sf.
Telegram Trigger with image (Works)
Code Node to make binary data(works) Sends image and i can "View" it in n8n
HTTP Node - Google Vision Api - The input from the code node shows the binary image data that you can view or download, but this node says, this is an item, but its empty.
Method - POST
Auth - Generic
Generic Auth - OAuth2 API
OAuth2 API - Unnamed credential (works and is to the proper google account)
No send parameters or anything else. Claude 3.7 has me just going in circles and writing and rewrtiting nodes over and over.
Ive tried OCR for the text extraction but that didnt work either.
Here is the code to handle the image from telegram:
try {
// Get the binary data structure from the previous node
const binaryData = $node["Telegram Trigger"].binary.data; // Create request parameters for Google Cloud Vision API
const requestParams = {
// The type of feature you want to detect
features: [
{
type: "TEXT_DETECTION", // Use TEXT_DETECTION for OCR functionality
maxResults: 1
}
],
// The image data is already being passed through in the binary property
// No need to explicitly include it here as the Vision node will handle that
};
return {
json: requestParams,
binary: {
// Pass through the binary data exactly as received
data: binaryData
}
};
} catch (error) {
return {
json: {
error: error.message
}
};
}