Connecting to SOAP API Using Ruby on Rails

Connect to your Marketing Cloud Engagement account using Ruby.

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

You can also use the Marketing Cloud Engagement Ruby 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: