function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jason Quevauvilliers 12Jason Quevauvilliers 12 

Einstein Feedback using URL

I am currently working with Einstein Vision for image prediction. I have made my own model and datasets and I have managed to do the image prediction successfully. However I am struggling with the Feedback aspect of Einstein. 

When doing a Prediction you can send it an image which is either on your local drive using the 'sampleContent' parameter, or you can send it an online image using the 'sampleLocation' parameter. 

Online Image:
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "sampleLocation=http://einstein.ai/images/546212389.jpg" -F "modelId=<MODEL_ID>" https://api.einstein.ai/v2/vision/predict

Local Image:
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "sampleContent=@C:\Users\JasonQ\Desktop\testImage.jpg" -F "modelId=<MODEL_ID>" https://api.einstein.ai/v2/vision/predict

However when doing a feedback call you have to use the 'data' parameter to pass the image. This only seems to support local images on your computer and not online images.

How it works:
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "modelId=<MODEL_ID>" -F "data=@C:\Users\JasonQ\Desktop\testImage.jpg" -F "expectedLabel=Beaches" https://api.einstein.ai/v2/vision/feedback

What I want to achieve:
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "modelId=<MODEL_ID>" -F "data=http://einstein.ai/images/546212389.jpg" -F "expectedLabel=Beaches" https://api.einstein.ai/v2/vision/feedback

Is it possible to do the feedback with an online image?
Also how would this change when I use apex instead of Curl to do the post?(I understand how to do a predict call in apex using base64Encode. Would it be similar?)

Thanks!