mailchimp-api icon indicating copy to clipboard operation
mailchimp-api copied to clipboard

Can I GET merge-fields using this class?

Open EdLem opened this issue 5 years ago • 1 comments

I am try to get merge fields, but I am unable to guess the exact syntax, if this i capable of getting merge-fields. Code is like:

include ("./MailChimp.php");

$list_id = $_POST['list_id']; $api_key = "mykey";

use \DrewM\MailChimp\MailChimp; $MailChimp = new MailChimp($api_key); $response = $MailChimp->get('lists/$list_id/merge-fields'); print_r($response);

I have also tried: $response = $MailChimp->get('lists/merge-fields', $list_id); and $response = $MailChimp->get('merge-fields', $list_id); and a whole bunch of other combinations, but everything produces:

Array ( [type] => http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/ [title] => Resource Not Found [status] => 404 [detail] => Invalid path [instance] => 8543a2f4-7f70-4ede-aada-00cf0621e443 )

I am able to get list information, so I have the basics working. I don't see any merge-fields when using: $response = $MailChimp->get('lists', $list_id);

which does return the details on any specific list. I originally thought that this GET would show the merge-fields, but they are not included in the array.

Thanks

EdLem avatar Apr 25 '19 16:04 EdLem

Which part of the API are you using here?

drewm avatar Aug 15 '19 11:08 drewm