C# app that calls the Salesforce Einstein Vision API. This app sends an image to the API, receives the prediction response and displays the response in text and in a graph.
-
Json.NET—Open source JSON Framework available from Newtonsoft. To install from VS, go to Tools > NuGet Package Manager > Package Manager Console. At the PM> prompt enter
Install-Package Newtonsoft.Json
. -
Einstein Platform account—Go to the sign-up page to sign up using your Salesforce credentials.
-
OAuth access token—Go to the token page to get a valid access token. Enter your email address and upload your key found in the
einstein_platform.pem
file.
You must update the variable with your access token to run the solution. In the btnPredict_Click
event, update this variable:
var authToken = "replace_with_your_token";
So that it looks like this but with your token:
var authToken = "8da2a2b54b04abc1sj39a7fabd160da4fd3df72";
Run the solution and click Predict.
This project was created using Visual Studio 2017 Community Edition. Thanks to Travis Illig for his illuminating blog post about multipart/form-data requests. His code to build the multipart request is included in this project.