@@ -113,16 +113,16 @@ EXAMPLES
113113 $ sf api request graphql --body example.txt --stream-to-file output.txt --include
114114```
115115
116- _ See code: [ src/commands/api/request/graphql.ts] ( https://github.com/salesforcecli/plugin-api/blob/1.3.0 /src/commands/api/request/graphql.ts ) _
116+ _ See code: [ src/commands/api/request/graphql.ts] ( https://github.com/salesforcecli/plugin-api/blob/1.3.1 /src/commands/api/request/graphql.ts ) _
117117
118118## ` sf api request rest [URL] `
119119
120120Make an authenticated HTTP request using the Salesforce REST API.
121121
122122```
123123USAGE
124- $ sf api request rest [URL] -o <value> [--flags-dir <value>] [--api-version <value>] [- i | -S Example: report.xlsx]
125- [-X GET|POST|PUT|PATCH|HEAD|DELETE|OPTIONS|TRACE] [-H key:value...] [-f file] [ -b file]
124+ $ sf api request rest [URL] -o <value> [--flags-dir <value>] [-i | -S Example: report.xlsx] [-X
125+ GET|POST|PUT|PATCH|HEAD|DELETE|OPTIONS|TRACE] [-H key:value...] [-f file | -b file]
126126
127127ARGUMENTS
128128 URL Salesforce API endpoint
@@ -133,13 +133,13 @@ FLAGS
133133 -X, --method=<option> HTTP method for the request.
134134 <options: GET|POST|PUT|PATCH|HEAD|DELETE|OPTIONS|TRACE>
135135 -b, --body=file File or content for the body of the HTTP request. Specify "-" to read from
136- standard input or "" for an empty body.
136+ standard input or "" for an empty body. If passing a file, prefix the
137+ filename with '@'.
137138 -f, --file=file JSON file that contains values for the request header, body, method, and
138139 URL.
139140 -i, --include Include the HTTP response status and headers in the output.
140141 -o, --target-org=<value> (required) Username or alias of the target org. Not required if the
141142 `target-org` configuration variable is already set.
142- --api-version=<value> Override the api version used for api requests made by this command
143143
144144GLOBAL FLAGS
145145 --flags-dir=<value> Import flag values from a directory.
@@ -156,30 +156,30 @@ DESCRIPTION
156156EXAMPLES
157157 List information about limits in the org with alias "my-org":
158158
159- $ sf api request rest 'limits' --target-org my-org
159+ $ sf api request rest 'services/data/v56.0/ limits' --target-org my-org
160160
161161 List all endpoints in your default org; write the output to a file called "output.txt" and include the HTTP response
162162 status and headers:
163163
164- $ sf api request rest '/' --stream-to-file output.txt --include
164+ $ sf api request rest '/services/data/v56.0/ ' --stream-to-file output.txt --include
165165
166166 Get the response in XML format by specifying the "Accept" HTTP header:
167167
168- $ sf api request rest 'limits' --header 'Accept: application/xml'
168+ $ sf api request rest '/services/data/v56.0/ limits' --header 'Accept: application/xml'
169169
170170 Create an account record using the POST method; specify the request details directly in the "--body" flag:
171171
172- $ sf api request rest sobjects/account --body "{\"Name\" : \"Account from REST API\",\"ShippingCity\" : \
173- \"Boise\"}" --method POST
172+ $ sf api request rest /services/data/v56.0/ sobjects/account --body "{\"Name\" : \"Account from REST \
173+ API\",\"ShippingCity\" : \"Boise\"}" --method POST
174174
175- Create an account record using the information in a file called "info.json":
175+ Create an account record using the information in a file called "info.json" (note the @ prefixing the file name) :
176176
177- $ sf api request rest 'sobjects/account' --body info.json --method POST
177+ $ sf api request rest '/services/data/v56.0/ sobjects/account' --body @ info.json --method POST
178178
179179 Update an account record using the PATCH method:
180180
181- $ sf api request rest 'sobjects/account/<Account ID>' --body "{\"BillingCity\": \"San Francisco\"}" --method \
182- PATCH
181+ $ sf api request rest '/services/data/v56.0/ sobjects/account/<Account ID>' --body "{\"BillingCity\": \"San \
182+ Francisco\"}" --method PATCH
183183
184184 Store the values for the request header, body, and so on, in a file, which you then specify with the --file flag;
185185 see the description of --file for more information:
@@ -222,7 +222,7 @@ FLAG DESCRIPTIONS
222222 https://github.com/salesforcecli/plugin-api/tree/main/test/test-files/data-project.
223223```
224224
225- _ See code: [ src/commands/api/request/rest.ts] ( https://github.com/salesforcecli/plugin-api/blob/1.3.0 /src/commands/api/request/rest.ts ) _
225+ _ See code: [ src/commands/api/request/rest.ts] ( https://github.com/salesforcecli/plugin-api/blob/1.3.1 /src/commands/api/request/rest.ts ) _
226226
227227<!-- commandsstop -->
228228
0 commit comments