class SendGrid::API
Public Class Methods
new(api_key:, host: nil, request_headers: nil, version: nil, impersonate_subuser: nil, http_options: {})
click to toggle source
-
Args :
-
host
-> the base URL for theAPI
-
request_headers
-> any headers that you want to be globally applied -
version
-> the version of theAPI
you wish to access,currently only "v3" is supported
-
impersonate_subuser
-> the subuser to impersonate, will be passedin the "On-Behalf-Of" header
-
http_options
-> http options that you want to be globally applied to each request
Calls superclass method
BaseInterface::new
# File lib/sendgrid/sendgrid.rb, line 14 def initialize(api_key:, host: nil, request_headers: nil, version: nil, impersonate_subuser: nil, http_options: {}) auth = "Bearer #{api_key}" host ||= 'https://api.sendgrid.com' super(auth: auth, host: host, request_headers: request_headers, version: version, impersonate_subuser: impersonate_subuser, http_options: http_options) end