README.md in smartsheet-1.2.0 vs README.md in smartsheet-1.3.0
- old
+ new
@@ -9,11 +9,11 @@
## Installation
Add this line to your application's Gemfile:
```ruby
-gem 'smartsheet', '>= 1.0.0'
+gem 'smartsheet', '>= 1.3.0'
```
And then execute:
$ bundle
@@ -64,20 +64,44 @@
end
```
See the [read-write-sheet](https://github.com/smartsheet-samples/ruby-read-write-sheet) example to see a more robust use case in action.
+## Conventions
+
+Each endpoint may take a number of keyword arguments, including the special keyword argument `body` for requests that accept a request body. Smartsheet's API Ruby documentation provides the parameters expected for each endpoint.
+
+Each endpoint also provides two optional keyword arguments:
+
+* `params` - This option is common for specifying enhancements or additional features for an API call. It specifies the query string for the call's URL.
+
+ This must be a hash of URL query string fields to their values. For example, to make a call with the query string `?include=comments&includeAll=true`, an API call would look like the following:
+
+ ```ruby
+ ...get( ..., params: {include: 'comments', includeAll: true})
+ ```
+
+* `header_overrides` - This option is less frequently used, as it overrides the HTTP headers sent by API calls on an individual basis. _Use with caution_, as some headers are required to allow the SDK to function properly.
+
+ This must be a hash of headers to override values. For example, to make a call with a modified `Assume-User` header set to `jane.doe@smartsheet.com`, an API call would look like the following:
+
+ ```ruby
+ ...get( ..., header_overrides: {'Assume-User' => 'jane.doe@smartsheet.com'})
+ ```
+
## Basic Configuration
When creating the client object, pass an object with any of the following properties to tune its behavior.
* `token` - Your smartsheet API access token. If you omit this property (or pass an empty string) then the access token will be read from the system environment variable `SMARTSHEET_ACCESS_TOKEN`.
* `max_retry_time` - The maximum time in seconds to retry intermittent errors. (Defaults to 15 seconds.)
-* `base_url` - By default, the SDK connects to the production API URL. Provide a custom base URL to connect to other environments.
+* `base_url` - By default, the SDK connects to the production API URL. Provide a custom base URL to connect to other environments. For example, to access SmartsheetGov, the `base_url` will be `https://api.smartsheetgov.com/2.0`.
+ * To access Smartsheetgov, you will need to specify the Smartsheetgov API URI, `https://api.smartsheetgov.com/2.0/`, as the `base_url` during creation of the Smartsheet client object. The Smartsheetgov URI is defined as a constant (`GOV_API_URL`).
+
## Advanced Configuration Options
### Logging Configuration
Smartsheet expects a standard Ruby logger. For example, to enable console logging of warnings and above, make a call such as the following:
@@ -156,11 +180,11 @@
`response = smartsheet.request_with_file(method:, url_path:, file:, file_length:, filename:, content_type:, params:, header_overrides:)`
`response = smartsheet.request_with_file_from_path(method:, url_path:, path:, filename:, content_type:, params:, header_overrides:)`
* `method`: The method to invoke, one of `:get`, `:post`, `:put`, or `:delete`
-* `url_path`: The specific API endpoint you wish to invoke. The client object base URL gets prepended to the caller’s endpoint URL argument. For example, passing a `url_path` of `sheets/1` to a standard client would give a URL like `https://api.smartsheet.com/2.0/sheets/1`
+* `url_path`: The specific API endpoint you wish to invoke. The client object base URL gets prepended to the caller’s endpoint URL argument.
* `body`: An optional hash of data to be passed as a JSON request body
* `file`: An opened `File` object to read as the request body, generally for file attachment endpoints
* `path`: The path of a file to be read as the request body, generally for file attachment endpoints
* `file_length`: The length of a file body in octets
* `filename`: The name of a file body
@@ -207,8 +231,8 @@
If you have any questions or issues with this SDK please post on [Stack Overflow using the tag "smartsheet-api"](http://stackoverflow.com/questions/tagged/smartsheet-api) or contact us directly at api@smartsheet.com.
## Release Notes
-Each specific release is available for download via [GitHub](https://github.com/smartsheet-platform/smartsheet-ruby-sdk/tags). Detailed release notes are available in [CHANGELOG.md].
+Each specific release is available for download via [GitHub](https://github.com/smartsheet-platform/smartsheet-ruby-sdk/tags). Detailed release notes are available in [CHANGELOG.md].
*Note*: Minor changes that result in a patch version increment in RubyGems (such as updates to the README) will not be tagged as a Release in GitHub.