class MarketoAPI::Client
The client to the Marketo SOAP API.
Constants
- DEFAULT_CONFIG
Attributes
The targeted Marketo SOAP API version.
The MarketoAPI::Campaigns
instance using this Client
.
The computed endpoint for Marketo.
If the most recent call resulted in an exception, it will be captured here.
The MarketoAPI::Leads
instance using this Client
.
The MarketoAPI::Lists
instance using this Client
.
Sets the logger.
The MarketoAPI::MObjects
instance using this Client
.
The subdomain for interacting with Marketo.
The WSDL used for interacting with Marketo.
Public Class Methods
Creates a client to talk to the Marketo SOAP API.
Required Configuration Parameters¶ ↑
The required configuration parameters can be found in your Marketo dashboard, under Admin / Integration / SOAP API.
api_subdomain
-
The endpoint subdomain.
api_version
-
The endpoint version.
user_id
-
The user iD for SOAP integration.
encryption_key
-
The encryption key for SOAP integration.
Version 1.0 will make these values defaultable through environment variables.
Savon Configuration Parameters¶ ↑
These affect how Savon interacts with the HTTP server.
read_timeout
-
The timeout for reading from the server. Defaults to 90.
open_timeout
-
The timeout for opening the connection. Defaults to 90.
pretty_print_xml
-
How the SOAP XML should be written. Defaults to
true
. ssl_verify_mode
-
How to verify SSL keys. This version defaults to
none
. Version 1.0 will default to normal verification. headers
-
Headers to use. Defaults to Connection: Keep-Alive. Version 1.0 will enforce at least this value.
Version 1.0 will require that these options be provided under a savon
key.
# File lib/marketo_api/client.rb, line 77 def initialize(config = {}) config = DEFAULT_CONFIG.merge(config) @api_version = config.delete(:api_version).freeze @subdomain = config.delete(:api_subdomain).freeze @logger = config.delete(:logger) user_id = config.delete(:user_id) encryption_key = config.delete(:encryption_key) @auth = AuthHeader.new(user_id, encryption_key) @wsdl = "http://app.marketo.com/soap/mktows/#{api_version}?WSDL".freeze @endpoint = "https://#{subdomain}.mktoapi.com/soap/mktows/#{api_version}".freeze @savon = Savon.client(config.merge(wsdl: wsdl, endpoint: endpoint)) end
Public Instance Methods
Indicates the presence of an error from the last call.
# File lib/marketo_api/client.rb, line 94 def error? !!@error end