A service account connects your project to Salesforce as one integration user, so Salesforce's own permissions decide what the integration's tools can read and change.
Before you start
You need a project. See Create a project.
Set up Salesforce
A Salesforce admin sets this up once per org.
Record sharing still applies: unless org-wide defaults allow it (Public Read Only for Account and Contact, Public Read/Write for Case), share the records with the user.
Case Edit always allows Status and Owner. To block them, add this validation rule on Case, with your integration user's username in place of [email protected]:
Text
$User.Username = "[email protected]" && (ISCHANGED(Status) || ISCHANGED(OwnerId))Connect the service account
- Set
PROJECTto your project's slug, from its address in Studio (/projects/<slug>):export PROJECT=<slug>. - Get the project with your API key:
Shell
curl https://api.veryfront.com/projects/$PROJECT \ -H "Authorization: Bearer $VERYFRONT_API_KEY" - Set
ENVIRONMENT_IDto theidof the entry namedproductionin itsenvironments:export ENVIRONMENT_ID=<id>. - Add the app's consumer key:
Shell
curl -X PUT https://api.veryfront.com/projects/$PROJECT/environments/$ENVIRONMENT_ID/variables/SALESFORCE_SERVICE_ACCOUNT_CLIENT_ID \ -H "Authorization: Bearer $VERYFRONT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"value": "<consumer key>"}' - Add its consumer secret:
Shell
curl -X PUT https://api.veryfront.com/projects/$PROJECT/environments/$ENVIRONMENT_ID/variables/SALESFORCE_SERVICE_ACCOUNT_CLIENT_SECRET \ -H "Authorization: Bearer $VERYFRONT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"value": "<consumer secret>"}' - Add your org's My Domain address:
Shell
curl -X PUT https://api.veryfront.com/projects/$PROJECT/environments/$ENVIRONMENT_ID/variables/SALESFORCE_SERVICE_ACCOUNT_LOGIN_URL \ -H "Authorization: Bearer $VERYFRONT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"value": "https://northwind.my.salesforce.com"}' - List your cases. You should now see them in
content, each with itsCaseNumber,SubjectandStatus:Shellcurl -X POST https://api.veryfront.com/integration-tools/salesforce__list_cases/run \ -H "Authorization: Bearer $VERYFRONT_API_KEY" \ -H "x-veryfront-project-slug: $PROJECT" \ -H "Content-Type: application/json" \ -d '{"arguments": {}}'
Troubleshooting
If you see provider-not-connected, "Authentication required for Salesforce.", the three variables aren't on Production. Add them, then list the cases again.