-
Notifications
You must be signed in to change notification settings - Fork 185
Configuration
Initial configuration is handled when creating a ZendeskAPI::Client instance.
ZendeskAPI::Client.new do |config|
# code goes here
endYou must set the URL that will be used as the basis of API calls. It should always be in the format "https://mysubdomain.zendesk.com/api/v2".
config.url = "https://mysubdomain.zendesk.com/api/v2"
Currently, this client only supports Zendesk's v2 API. However, for forwards compatibility please make sure you have /api/v2 at the end of the URL, otherwise you may get cryptic error messages.
You must set up some form of (authentication)[Authentication.md].
Setting the retry option to true will, after hitting the rate limit: notify the user, sleep automatically (based on the X-Retry-After header), and then retry the request.
config.retry = true
Logging can be controlled with the logger option. By default the logger will log WARN messages to STDERR.
# Both of these settings are the default:
config.logger = nil
config.logger = true
# For example, to log to STDOUT:
require 'logger'
config.logger = Logger.new(STDOUT)
You may change the faraday adapter through the adapter option or by setting Faraday.default_adapter.
config.adapter = :patron
The configuration can be accessed after Client initialization through ZendeskAPI::Client#config.