rest - How to fetch email lists from MailChimp RestAPI -


i using mailchimp api 3.0. trying email lists new api , following works fine.

http://usxx.api.mailchimp.com/3.0/lists/3399ju772?apikey=xxyy3399ddff87336663-usxx 

the api key , list id provided fake. using above code gets me list id , related contents. however, tried grab name of list using following code

http://usxx.api.mailchimp.com/3.0/lists?fields=lists.name/99uy6633?apikey=xxxyyyzzzxxxeeee-usxx 

and following error

   {"type":"http://kb.mailchimp.com/api/error-docs/401-api-key-missing","title":"api key missing","status":401,"detail":"your request did not include api key.","instance":"99hhytt-5444f-453gfgfg-bfgfg4bd-4545ggfg"} 

is there syntax error? couldn't find syntax in documentation except here

i appreciate help.

mailchimp api 3.0 has issue if multiple query-parameters provided (at least apikey , exclude_fields or fields). instead of providing apikey query-parameter can provide within password field of authorization header. username can according documentation want.

a request partial response of name , city of contact of list username of abcd , apikey of xxyy3399ddff87336663-usxx has if invoked curl:

curl -xget -h "authorization: basic ywjjzdpywflzmzm5ourerky4nzmznjy2my11c1hy" https://usxx.api.mailchimp.com/3.0/lists/{listid}/?fields=name,contact.city 

note username , password base64 encoded representation of abcd:xxyy3399ddff87336663-usxx!

the response request above follows in case:

{ "name": "testlist", "contact": { "city": "vienna" }} 

Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -