Use the OCR Model to Detect Text
In this walkthrough, you use the Einstein OCR API to pass an image into the OCR model. The model detects any text in the image and returns the text and other details in the response.
A valid JWT token is required to make API calls.
Find your key file. If you already created an account, locate the
einstein_platform.pemfile that you downloaded as part of that process. This file contains your private key.
Install cURL. You use the cURL command-line tool throughout the following walkthrough. The tool is installed by default on Linux and OSX. If you don’t already have it installed, download it from https://curl.haxx.se/download.html. Alternatively, you can use Postman to make API calls.
Get a token. The Einstein Intent API uses the OAuth 2.0 JWT bearer token flow for authorization. Use the token page to upload your key file and generate a JWT token.
Copy and paste the following cURL call into a text editor and replace
<TOKEN> with your valid token. This command works on Windows. If you're on Linux, it can require some format changes, such as from double quotes to single quotes. This command uses the model OCRModel.
The URL references this image.
You get a response like the following JSON.