Hello,
This question has been asked here before (at least four times that I could find), but there was no expression of a resolution, which is why I'm asking again.
We have had success integrating with the MailChimp API for performing list/subscribe and list/unsubscribe actions. We make both of these requests with JSON objects, and they both work without any trouble. However, we are having trouble with our webhooks integration, and we could use some assistance.
We have set up our webhooks to use a URL with an arbitrary querystring key, as recommended. The webhook is configured to send subscribe and unsubscribe actions made by a subscriber.
When we set up the webhook, we see our webhook callback URL log an empty POST request, which is what we expect during a URL validation action.
Then we send a test campaign email to test subscribers. When we click the "unsubscribe" link in one of those emails, we see immediately see another POST request come to our webhook callback URL, but again, the POST is empty. This is all being performed in a test environment, so we know that we are the only ones instigating these actions. We assume that the webhook is performing another URL validation before sending the actual unsubscribe callback, but we never see a request with actual POST data come through.
Here is the diagnostic code behind the webhooks URL (C#):
// make sure we get the webhook key we put in the webhook URL
string WebHookKey = Request.QueryString["whk"];
if (string.IsNullOrEmpty(WebHookKey) || !WebHookKey.Equals(MailChimpUtility.WebHookKey)) return;
// loop through all POST variables
StringBuilder sb = new StringBuilder("contents of request variables:\n\n");
foreach (string key in Request.Form.Keys)
sb.AppendLine("key: " + key + " = value: " + Request.Form[key]);
// log POST variables we found
When we click unsubscribe in the test email, "Log" is writing "contents of request variables:" and nothing else, suggesting there are no POST variables. We assume that this is because the webhook is validating the URL before sending the actual unsubscribe request. Is that possible? If so, how long does the actual unsubscribe request take to send, because we haven't seen a POST request come through with data yet. If not, do you have any ideas as to how we can diagnose this issue further?
Thanks,
Jason