0

I'm trying to verify a hook in my Podio App.

Here's the code I'm running:

Podio::setup(PODIO_API_ID, PODIO_API_KEY);

// Turn on debugging
Podio::$debug = true;

// Authenticate the app
try {
Podio::authenticate('app', array('app_id' => PODIO_HELPDESK_APP_ID, 'app_token' => PODIO_HELPDESK_APP_TOKEN));
}
catch (PodioError $e) {
  // Something went wrong. Examine $e->body['error_description'] for a description of the error.
  $dbObject->logger->logDebug("podio exception: ".print_r($e,true) );
}

$dbObject->logger->logDebug("access token: ".print_r( Podio::$oauth->access_token,true)); // Your access token

$dbObject->logger->logDebug("podio event POST: ".print_r($_POST,true) );
$dbObject->logger->logDebug("podio event GET: ".print_r($_GET,true) );

So the page fires when I click the "verify" button on my hooks page - I'm getting some debug info logged. The I'm able to output an access token, but $_POST and $_GET are both empty.

What am I doing wrong?

  • Can you look at your web server's access log? For example, in DirectAdmin you can view it at 'Site Summary / Statistics / Logs -> Full Usage Log'. You can use $_SERVER to get some more data. Maybe you can post that information here? – Stephan Vierkant Sep 10 '13 at 11:14
  • I'll post the contents of the entire $_SERVER variable first. It'll be a few comments long. – user2033627 Sep 10 '13 at 21:51
  • ( [CONTENT_TYPE] => application/x-www-form-urlencoded [DOCUMENT_ROOT] => ... [GATEWAY_INTERFACE] => CGI/1.1 [HTTP_ACCEPT] => */* [HTTP_ACCEPT_ENCODING] => gzip, deflate, compress [HTTP_HOST] => www..com [HTTP_USER_AGENT] => python-requests/0.14.2 CPython/2.7.3 Linux/3.2.0-43-generic [HTTP_X_NEWRELIC_ID] => UQAOVlRACgMDU1VU [HTTP_X_NEWRELIC_TRANSACTION] => PxQDVgRUXlcFUANQBQkEBQUCFB9CAAIOQwdl [PATH] => /bin:/usr/bin [PHPRC] => /home/ [QUERY_STRING] => [REDIRECT_STATUS] => 200 [REMOTE_ADDR] => 78.108.126.18 [REMOTE_PORT] => 50863 [REQUEST_METHOD] => GET – user2033627 Sep 10 '13 at 21:53
  • [REQUEST_METHOD] => GET [REQUEST_URI] => /rental/_c.php [SCRIPT_FILENAME] => /home1/_c.php [SCRIPT_NAME] => /rental/_c.php [SERVER_ADDR] => x.x.x.x [SERVER_ADMIN] => webmaster@ [SERVER_NAME] => www..com [SERVER_PORT] => 80 [SERVER_PROTOCOL] => HTTP/1.1 [SERVER_SIGNATURE] =>
    Apache Server at www.dev-kharma.com Port 80
    [SERVER_SOFTWARE] => Apache [UNIQUE_ID] => Ui@S4TJXkF4AAHcZGeQAAAVQ [PHP_SELF] => /rental/_c.php [REQUEST_TIME] => 1378849505
    – user2033627 Sep 10 '13 at 21:54
  • and this is the apache server log entry: 78.108.126.18 - - [10/Sep/2013:16:43:19 -0500] "POST /rental/_c.php HTTP/1.1" 302 316 "-" "python-requests/0.14.2 CPython/2.7.3 Linux/3.2.0-43-generic" 78.108.126.18 - - [10/Sep/2013:16:43:19 -0500] "GET /rental/_c.php HTTP/1.1" 200 20 "-" "python-requests/0.14.2 CPython/2.7.3 Linux/3.2.0-43-generic" – user2033627 Sep 10 '13 at 21:54
  • What if you enter c.php?test=1? You have to check if there is a problem just with Podio, or a problem with your webserver's settings. Maybe you can post your php.ini and/or .htaccess? You can use [Pastbin.com](http://pastebin.com/) if your text is too long for a comment. – Stephan Vierkant Sep 11 '13 at 07:38
  • Wow, yeah, pastebin is great. http://pastebin.com/wgdb60Bd. I'll post the php.ini and .htaccess as well. This script is running alongside several other scripts that are processing post and get stuff without any trouble, so I doubt the problem's there. We can see that it's going through port 80, so that's not it, and clearly the call itself is being made to the correct URL because the page's logger is getting called right after I click on the "Hooks" page. – user2033627 Sep 11 '13 at 15:32
  • Are there any filters on the Podio side that determine if the POST variables are populated? (e.g. HTTPS or a whitelist of domains?) – user2033627 Sep 11 '13 at 15:35

1 Answers1

0

When webhooks are not received or data is missing the problem is almost always with the URL or the receiving server's configuration. Make sure that:

  • The URL of your script matches the URL you registered the webhooks with exactly. Pay special attention to for example the www subdomain or trailing slashes that could result in redirects where your server could drop the payload
  • Any kind of firewall on your end that strips the POST data