Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Mail::Chimp3 Add Member

by 1nickt (Canon)
on Jan 27, 2020 at 20:25 UTC ( [id://11111939]=note: print w/replies, xml ) Need Help??


in reply to Mail::Chimp3 Add Member

Hi,

"object" there refers to a JSON object that the MailChimp server is expecting to receive as the value of the merge_fields param, not a Perl object.

The module you are using handles converting your arguments to add_member into the right format for the HTTP call, but as Fletch said you are passing in a hash, which expands to a list, so merge_fields is getting as its value just the first key from your hash (and a bunch of other bogus params are being passed and presumably ignored).

When you pass a reference to the hash instead it is a single data structure and the module will properly convert it to a JSON "object" when making the call to MailChimp.

Hope this helps!


The way forward always starts with a minimal test.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11111939]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found