File: rest.nu 5 exported commands 0 internal commands

sf rest

Make a generic REST API call to Salesforce.

The path is relative to the base REST URL (e.g. /services/data/v59.0/).

Usage

sf rest {flags} <path>

Flags

-h, --help
Display the help message for this command
--method <string>
HTTP method (GET, POST, PATCH, PUT, DELETE) (default: 'GET')
--data <any>
Request body for POST/PATCH/PUT

Parameters

path <string>
Path relative to the base REST URL

Input/output types

#inputoutput
0anyany

Examples

list sobjects

sf rest "sobjects"

reset a user password

sf rest "sobjects/User/005.../password" --method POST --data {NewPassword: "secret"}

get org limits

sf rest "limits/"

sf apex

Make a call to a Salesforce Apex REST endpoint.

The action is appended to the Apex REST base URL (/services/apexrest/).

Usage

sf apex {flags} <action>

Flags

-h, --help
Display the help message for this command
--method <string>
HTTP method (default: 'GET')
--data <any>
Request body for POST/PATCH/PUT

Parameters

action <string>
Apex REST endpoint path

Input/output types

#inputoutput
0anyany

Examples

call a custom Apex endpoint

sf apex "MyCustomEndpoint"

post data to a custom Apex endpoint

sf apex "MyCustomEndpoint" --method POST --data {key: "value"}

sf tooling

Make a call to the Salesforce Tooling API.

The action is appended to the Tooling API base URL.

Usage

sf tooling {flags} <action>

Flags

-h, --help
Display the help message for this command
--method <string>
HTTP method (default: 'GET')
--data <any>
Request body for POST/PATCH/PUT

Parameters

action <string>
Tooling API endpoint path

Input/output types

#inputoutput
0anyany

Examples

query Apex classes via Tooling API

sf tooling "query/?q=SELECT+Id+FROM+ApexClass+LIMIT+5"

list ApexClass sobjects

sf tooling "sobjects/ApexClass"

sf limits

Show the organization's API usage limits.

Usage

sf limits

Flags

-h, --help
Display the help message for this command

Input/output types

#inputoutput
0anyany

Examples

show all API limits

sf limits

get daily API request limits

sf limits | get DailyApiRequests

sf describe-all

Describe all available SObjects in the org.

Usage

sf describe-all

Flags

-h, --help
Display the help message for this command

Input/output types

#inputoutput
0anyany

Examples

describe all sobjects

sf describe-all

list sobject names and labels

sf describe-all | get sobjects | select name label