Class: SendGrid::API
- Inherits:
-
BaseInterface
- Object
- BaseInterface
- SendGrid::API
- Defined in:
- lib/sendgrid/sendgrid.rb
Instance Attribute Summary
Attributes inherited from BaseInterface
#client, #host, #http_options, #impersonate_subuser, #request_headers, #version
Instance Method Summary collapse
-
#initialize(api_key:, host: nil, request_headers: nil, version: nil, impersonate_subuser: nil, http_options: {}) ⇒ API
constructor
-
Args : -
api_key
-> your Twilio SendGrid API key -host
-> the base URL for the API -request_headers
-> any headers that you want to be globally applied -version
-> the version of the API you wish to access, currently only “v3” is supported -impersonate_subuser
-> the subuser to impersonate, will be passed in the “On-Behalf-Of” header -http_options
-> http options that you want to be globally applied to each request.
-
Methods inherited from BaseInterface
Constructor Details
#initialize(api_key:, host: nil, request_headers: nil, version: nil, impersonate_subuser: nil, http_options: {}) ⇒ API
-
Args :
-
api_key
-> your Twilio SendGrid API key -
host
-> the base URL for the API -
request_headers
-> any headers that you want to be globally applied -
version
-> the version of the API 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
-
14 15 16 17 18 19 |
# 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: ) end |