pozil / legacy-api-scanner

Scan for Salesforce Legacy API calls
Creative Commons Zero v1.0 Universal
17 stars 5 forks source link
api legacy salesforce scanner

Legacy API Scanner

Run this anonymous Apex code to to identify if your Salesforce org is receiving legacy SOAP, REST or Bulk API calls as defined in this knowledge article.

The scanner inspects the ApiTotalUsage event logs and lists outdated API calls with their API type and versions.

ℹ️  Disclaimers:

Instructions

  1. Clone this repository and navigate to the project folder:

    git clone git@github.com:pozil/legacy-api-scanner.git
    cd legacy-api-scanner
  2. Run the anonymous Apex code to run a scan with the Salesforce CLI:

    sfdx force:apex:execute -f legacy-api-scanner.apex -u <YOUR_USERNAME>
  3. Inspect the Apex debug logs

    If you have legacy API calls in your org's logs, you will see this kind of output:

    Found legacy API versions in logs: {SOAP v7, REST v20, BULK_AP v21}

    If that's the case, continue your investigations manually as indicated in this knowledge article.

    Otherwise, you will see this message:

    Found no EventLogFile entry of type ApiTotalUsage.
    This indicates that no legacy APIs were called during the log retention window.

    This means that there could still be some legacy API calls made against your org, but they are outside of the log retention window.

    API enabled organizations have free access to the API Total Usage event log files with 1-day data retention. For an extra cost, you can access this and all other log file types with 30-day data retention.