Connecting to SOAP API Using Ruby on Rails

Use Ruby on Rails sample code and language details here to connect your development environment, or other systems to the Marketing Cloud via SOAP API.

You can use the connection to the SOAP API to test your calls and perform various tasks, such as sending email and retrieving tracking information.

You must download and install the following in order to connect to the SOAP API via Ruby on Rails:

  • soap4r (soap4r-ruby19 if using Ruby v1.9)
  • wss4r
  • wsse

Marketing Cloud also provides a full Ruby on Rails SDK for connecting your environment and developing your projects.

Download Ruby on Rails SDK

Follow the directions below to connect to the SOAP API using Ruby on Rails:

The sample code below demonstrates how to connect and interact with the SOAP API.

You can generate your own Ruby on Rails drivers using wsdl2ruby.rb and typing the following command in your command line.

Use the following syntax to execute a Ruby on Rails file in a shell:

Use the sample code below to authenticate your Ruby on Rails environment to the SOAP API: