Webhooks not passing GET values

318 views
Skip to first unread message

benji++

unread,
Dec 14, 2009, 5:52:27 PM12/14/09
to MailChimp API Discuss
I'm new to using the MailChimp Webhooks feature, but it seems like
there might be something going wrong. I followed the Webhook
instructions carefully from the MailChimp API site and am basing my
code on the PHP sample at http://www.mailchimp.com/api/downloads/webhooks.phps.
But the security key is not getting passed to my webhook when
MailChimp sends a request to it. I do have the Webhook URL entered
with ?key=stuff on the end in my MailChimp list settings. But in the
_REQUEST dump array in my log I get a value like:

[/webhooks/list_signup_php] =>

Obviously, that's the file path part of my webhook URL, which it seems
to be interpreting as part of the GET string, and the value is empty.

When I impersonate a MailChimp post, just using a form of my own that
posts to my webhook with the key in the GET string, everything works
successfully. My log shows:

[key] => stuff

as it should, and the subscribe function goes through instead of "No
security key specified, ignoring request".

I'm sure there are plenty of other people using webhooks just fine, so
am I missing something? I double-checked that I'm subscribing to the
same list where I've entered my webhook. I tried adding something
extraneous to the GET string, like &extra=1, but it doesn't get passed
through either. Help?

jesse

unread,
Dec 14, 2009, 6:07:26 PM12/14/09
to MailChimp API Discuss
I just tested this again and it worked fine, so I'm not real sure what
to tell you. Even when you save or re-saved the url in the webhook
setup we'll reach out and ping it to make sure it's alive. Doing that
I get the expected output from that script:
2009-12-14 18:00:29 | ==================[ Incoming Request ]
==================
2009-12-14 18:00:29 | Full _REQUEST dump:
Array
(
[key] => EnterAKey!
)
2009-12-14 18:00:29 | Processing a "" request...
2009-12-14 18:00:29 | Request type "" unknown, ignoring.
2009-12-14 18:00:29 | Finished processing request.

One thing interesting about your post is that dumping the REQUEST
variable is *not* going to include the script path, so you may have
managed to get it setup such that your PHP thinks it's a key. Is there
any sort of proxy or something that our call has to go through to get
to your server? If so, it's possible that is mangling our request.
Have you tried entering a PostBin url (check the Webhooks docs) to see
the data get dumped there?


jesse


On Dec 14, 5:52 pm, "benji++" <bheneg...@speakeasy.net> wrote:
> I'm new to using the MailChimp Webhooks feature, but it seems like
> there might be something going wrong.  I followed the Webhook
> instructions carefully from the MailChimp API site and am basing my
> code on the PHP sample athttp://www.mailchimp.com/api/downloads/webhooks.phps.

Ben Heneghan

unread,
Dec 14, 2009, 6:15:04 PM12/14/09
to mailchimp-...@googlegroups.com
Oh, yeah, got it, jesse. It's probably because it's going through my
CMS. I'm using concrete5, where everything goes through index.php's
controller. My webhook is at /webhooks/list_signup.php but
mod_rewrite sends it to /index.php/webhooks/list_signup.php, where
everything after index.php must get mangled into the GET string. I
forgot about that. Thanks for pointing me in the right direction.
I'll have to figure out how to get around it.

benji
> --
>
> You received this message because you are subscribed to the Google
> Groups "MailChimp API Discuss" group.
> To post to this group, send email to mailchimp-api-
> dis...@googlegroups.com.
> To unsubscribe from this group, send email to mailchimp-api-discuss
> +unsub...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/
> group/mailchimp-api-discuss?hl=en.
>
>
>

jesse

unread,
Dec 14, 2009, 6:19:05 PM12/14/09
to MailChimp API Discuss
FWIW, we've had that same problem with our Expression Engine based
site (the www site, not the app). In every case, we've simply changed
our .htaccess rules to prevent a url from being rewritten and rerouted
so that a simple php script can catch and process the data.


jesse

benji++

unread,
Dec 14, 2009, 6:59:53 PM12/14/09
to MailChimp API Discuss
Thanks, that does help.
Reply all
Reply to author
Forward
0 new messages