Handle Salesforce API versions deprecation and retirement
You probably noticed a bunch of messages from Salesforce warning you about future API versions deprecations and retirements
This may look frightening.
And it should be.
Why? Because it can break your production org processes.
Before explaining how to solve this nightmare scenario,
let’s see with a real-life example what will happen if you do nothing.
Worst case scenario
A company integrated its Salesforce org with a web portal
and a mobile app that directly reads and writes records using SOAP API and REST
API.
Payments are managed with Sage, and Talend ETL is used to
integrate it using Bulk API
Summer 21
In Summer ‘21, SOAP API v12.0, REST API v18.0 and Bulk API
v19.0 have been deprecated. This means that they still work, but if there is
any issue with them, Salesforce will not provide any fix, as those versions are
officially not supported anymore.
Summer ‘22
In Summer ’22, SOAP API v12.0, REST API v18.0 and Bulk API v19.0 have been retired, so any call to such API versions will just return an error.
This means that in our case, the web portal, the mobile app, and the payment system won’t be communicating with Salesforce anymore!
Diagnosis
Now you know how the worst-case scenario may happen, let’s
check if your Salesforce production org will be impacted and when, using an
open-source sfdx-hardis command, provided by Salesforce team at Hardis Group.
sfdx-hardis setup
Please follow sfdx-hardis
installation instructions, launch Visual Studio Code in an empty folder (or
a sfdx project if you have one) and open sfdx-hardis extension (1)
Run sfdx hardis:org:diagnose:legacyapi
In Audit menu, click on Detect Legacy API use (2), then click on Other when type of Salesforce org is prompted (3)
Authenticate to your production org on Salesforce login page.
Go back to Visual Studio Code window, and look in the
console log
If you see only green, you can stop this article here,
you’re all good!
If you see red, it means that external applications are calling your Salesforce production org using API versions that are or will be deprecated then disabled, making possible the worst scenario to happen.
Solution
sfdx-hardis legacy API detection command generates 2 types
of CSV log files:
● a full log of all API calls and API version for each of
them
● summary logs
By opening summary logs, you can identify the applications
responsible for API calls using a deprecated API version
IP without hostnames are probably internal applications
hosted on servers without DNS , you can guess what they are by analyzing the
detailed API calls log, and also by finding
the IP in your Login History logs .
Once the external applications have been identified, contact
their admins and ask them to update the api version in the endpoint URLs they
use, following these examples:
REST
https://virtualcompany.salesforce.com/services/data/v18.0/sobjects/Account
https://virtualcompany.salesforce.com/services/data/v53.0/sobjects/Account
SOAP
https://virtualcompany.salesforce.com/services/Soap/c/12.0/
https://virtualcompany.salesforce.com/services/Soap/c/53.0/
Bulk API
https://virtualcompany.salesforce.com/services/async/19.0/job
https://virtualcompany.salesforce.com/services/async/53.0/job
Conclusion
Now you’re all set for the next 10 years
No comments:
Post a Comment