drewm / mailchimp-api

Super-simple, minimum abstraction MailChimp API v3 wrapper, in PHP
MIT License
1.99k stars 506 forks source link

400 - Invalid interest ID: 'c06bb4b529'. #294

Open nekromoff opened 4 years ago

nekromoff commented 4 years ago

Hi,

I am getting error mentioned in the title. However, I am sure interest with that ID exists, as I can see it both in the admin and in the API playground.

$payload = [
        'email_address' => $data['email'],
        'status'        => 'subscribed',
    ];
    if (isset(INTERESTS[$data['campaign_id']])) {
        $payload['interests'] = ['c06bb4b529' => true];
    }
    $result = $mailchimp->post('lists/' . $list_id . '/members', $payload);

result

Array
(
    [type] => http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/
    [title] => Invalid Resource
    [status] => 400
    [detail] => Invalid interest ID: 'c06bb4b529'.
    [instance] => 5a20481d-e4a8-40da-845b-[redacted]
)

Any ideas?

Tbiniimene commented 2 years ago

I'm having the same issue even tho I have the correct id

Tbiniimene commented 2 years ago

help?

WaqarTabish2807 commented 2 years ago

same issue

Tbiniimene commented 2 years ago

You have to figure out how your Mailchimp account is set up (groups or tags and how they are actually set up) and write your code accordingly.