Org-level resources: API limits, the available API versions, and parsing the Sforce-Limit-Info usage header.
Functions
api-usage
fn (header: Any): Any
Parse a Sforce-Limit-Info header value (api-usage=25/15000) into
{used, max}, or null when it does not match. Exposed for testing.
Example
::salesforce::org/api-usage("api-usage=25/15000") // {used: 25, max: 15000}
::salesforce::org/api-usage("none") // null
limits
fn (): Map
fn (opts: Map): Map
GET /limits - The org's limits, each {Max, Remaining}:
DailyApiRequests, DailyBulkV2QueryJobs, DataStorageMB, and
many more.
Example
l ::salesforce::org/limits()
l.DailyApiRequests.Remaining
versions
fn (): Vec
fn (opts: Map): Vec
GET /services/data - The REST API versions the org supports ([{version, label, url}]), oldest first. Use it to pick salesforce.api.version
for an older org.
Example
all ::salesforce::org/versions()
last(all).version