I can't understand why I get an Invalid array!
response = Unirest.post "#{@@endpoint}/messages/send.json",
headers:{ "Accept" => "application/json" },
parameters:{
:key => @@apikey,
:message => {
:text => "example text",
:subject => "bla bla",
:from_email => "[email protected]",
:from_name => "site.com",
to: [
{
:email => "[email protected]",
:name => "myname",
:type => "to"
}
]
}
}
I get this error
{"status":"error","code":-2,"name":"ValidationError","message":"Validation error: {\"message\":{\"to\":[\"Please enter an array\"]}}"}
Shouldn't the to array be
[to]=>
array(
[0]=>array(
[email] => "[email protected]",
[name] => "myname",
[type] => "to"
)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With