Create the Apex Classes
In this step, you create the Apex classes that call the API and do all of the heavy lifting.
-
In Salesforce, from Setup, enter
Apex Classes
in the Quick Find box, then select Apex Classes. -
Click New.
-
To create the
JWT
Apex class, copy all the code fromJWT.apex
into the Apex Class tab and click Save. -
To create the
JWTBearerFlow
Apex class, go back to to the Apex Classes page, and click New. -
Copy all the code from
JWTBearer.apex
to the Apex Class tab and click Save. -
To create the
HttpFormBuilder
Apex class, go back to the Apex Classes page, and click New. -
Copy all the code from
HttpFormBuilder.apex
into the Apex Class tab and click Save. -
To create the
Vision
Apex class, go back to the Apex Classes page, and click New. -
Copy all the code from
Vision.apex
into the Apex Class tab and click Save. -
To create the
VisionController
Apex class, go back to the Apex Classes page, and click New. -
Copy the VisionController code from the apex-utils
README.md
into the Apex Class tab. This class is all the code frompublic class VisionController {
to the closing brace}
. In this example, the expiration is one hour (3600 seconds). -
Update the
jwt.sub
placeholder text ofyourname@example.com
with your email address. Use your email address that’s contained in the Salesforce org you logged in to when you created an account.
Use your email address that’s contained in the Salesforce org you logged in to when you created an account. Be sure to use your email address and not your Salesforce username.
- Click Save.