using ruby wrapper returns no data back

I am using the API_KEY but I get no data back, any ideas?

cs = :api_key => API_KEY
=> #<CreateSend::CreateSend:0x110d01d10 @auth_details={:api_key=>API_KEY}>

client = cs.clients.first
=> #<Hashie::Mash ClientID="ID" Name="WhiteGlove Health">

=> nil
>> client.campaigns
=> nil
>> client.billing
=> nil

cristianrasch, 3 years ago


Any update on this issue? I'm myself experiencing a similar problem when connecting to the Campaign Monitor API via the ruby library using both the API token and OAuth techniques:

cs = "the-api-key")

# or

auth = {
  :access_token => 'a fresh access token',
  :refresh_token => 'the refresh token'
cs = auth

and every time I get the same empty response:

client = cs.clients.first
client.lists # => nil
client.campaigns # => nil

I'm using the latest versions of both the createsend and omniauth-createsend libraries.
One more thing I'd like to add is that I'm perfectly able to retrieve the clients in my account with their name and clientID, it's the subscriber lists and active campaigns that come in empty.

Any help will be appreciated, thanks!

terryt terryt, 3 years ago

Hi cristianrasch,

I'm afraid the wrapper doesn't work the way you're expecting it to. Our wrappers were created to reflect our API documentation very closely so that it would be easy to use the wrapper through that documentation.

In the example you've provided, you would need to write the code like this:

clientId = cs.clients.first.ClientID
client =, clientId)

Please let me know if you have any further questions or concerns!

Terry Tice
Campaign Monitor
cristianrasch, 3 years ago

Hey terryt,

That certainly works, thanks for your help, I really appreciate it.

JeanTBalk, 3 years ago


See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free