API Stopped Working - Build2024-03-28T22:24:11Zhttp://build.ning.com/forum/topics/api-stopped-working?commentId=6308082%3AComment%3A16832&xg_source=activity&feed=yes&xn_auth=noAwesome, glad to hear it's al…tag:build.ning.com,2012-05-07:6308082:Comment:168322012-05-07T18:44:37.991ZPhillip Pearsonhttp://build.ning.com/profile/PhillipPearson
<p>Awesome, glad to hear it's all working!</p>
<p>Awesome, glad to hear it's all working!</p> Cheers Phillip,
The provider…tag:build.ning.com,2012-05-07:6308082:Comment:165592012-05-07T17:32:59.583ZAlex Seymourhttp://build.ning.com/profile/AlexSeymour
<p>Cheers Phillip,</p>
<p>The provider has updated the clocks and all is working great.</p>
<p>Thanks for your help with debugging, I would not have figured this out without your help.</p>
<p>Alex</p>
<p>Cheers Phillip,</p>
<p>The provider has updated the clocks and all is working great.</p>
<p>Thanks for your help with debugging, I would not have figured this out without your help.</p>
<p>Alex</p> Ahh... yes, that sounds like…tag:build.ning.com,2012-05-07:6308082:Comment:166622012-05-07T03:00:11.061ZPhillip Pearsonhttp://build.ning.com/profile/PhillipPearson
<p>Ahh... yes, that sounds like the problem. Your server's probably in a different timezone, but if it thinks it's xx:30 when it's actually xx:39, that's enough for the timestamp to be incorrect. 300 seconds is 5 minutes, so 9 mins off is far too much! Let me know if the problem doesn't go away once your provider updates its clocks :)</p>
<p></p>
<p>(Your provider probably knows this already, but just in case they don't: they should be running some kind of ntp listener, to track one of the…</p>
<p>Ahh... yes, that sounds like the problem. Your server's probably in a different timezone, but if it thinks it's xx:30 when it's actually xx:39, that's enough for the timestamp to be incorrect. 300 seconds is 5 minutes, so 9 mins off is far too much! Let me know if the problem doesn't go away once your provider updates its clocks :)</p>
<p></p>
<p>(Your provider probably knows this already, but just in case they don't: they should be running some kind of ntp listener, to track one of the publicly available Internet time services and keep their servers in sync.)</p> ok, it's 7:39pm here.
I added…tag:build.ning.com,2012-05-06:6308082:Comment:166612012-05-06T23:44:15.337ZAlex Seymourhttp://build.ning.com/profile/AlexSeymour
<p>ok, it's 7:39pm here.</p>
<p>I added the code:</p>
<p>echo date("m/d/Y h:i:s a", time());</p>
<p>My server thinks it is 11:30pm. <br/>I'll contact my hosting provider and see what is going on.</p>
<p>Thanks Phillip.</p>
<p></p>
<p>Alex</p>
<p></p>
<p>ok, it's 7:39pm here.</p>
<p>I added the code:</p>
<p>echo date("m/d/Y h:i:s a", time());</p>
<p>My server thinks it is 11:30pm. <br/>I'll contact my hosting provider and see what is going on.</p>
<p>Thanks Phillip.</p>
<p></p>
<p>Alex</p>
<p></p> Hi Philip,
Thank you so much…tag:build.ning.com,2012-05-06:6308082:Comment:168272012-05-06T23:25:52.028ZAlex Seymourhttp://build.ning.com/profile/AlexSeymour
<p>Hi Philip,</p>
<p></p>
<p>Thank you so much for your help so far.</p>
<p>This is the response I get back with the code you posted above:</p>
<p></p>
<p>Fetch Recent Photos..Error: The oauth_timestamp value is unacceptable to the Service Provider. The timestamp of the request must be within 300 seconds of the current time Acceptable range: 1336346254-1336346855 #0 /var/www/app.royalcanin.ca/ning/api/ning-api-php/NingApi.php(213): NingException::generate(Array) #1…</p>
<p>Hi Philip,</p>
<p></p>
<p>Thank you so much for your help so far.</p>
<p>This is the response I get back with the code you posted above:</p>
<p></p>
<p>Fetch Recent Photos..Error: The oauth_timestamp value is unacceptable to the Service Provider. The timestamp of the request must be within 300 seconds of the current time Acceptable range: 1336346254-1336346855 #0 /var/www/app.royalcanin.ca/ning/api/ning-api-php/NingApi.php(213): NingException::generate(Array) #1 /var/www/app.royalcanin.ca/ning/api/ning-api-php/NingApi.php(220): NingApi->call('Token', 'POST', NULL, Array, true) #2 /var/www/app.royalcanin.ca/ning/api/ning-api-php/NingApi.php(119): NingApi->post('Token', NULL, Array, true) #3 /var/www/app.royalcanin.ca/ning/api/ning-api-php/NingApi.php(61): NingApi->login('nblackwell@roya...', 'Royalcan1n') #4 /var/www/app.royalcanin.ca/ning/api/ning-api-php/NingApi.php(34): NingApi->__construct() #5 /var/www/app.royalcanin.ca/ning/api/test.php(19): NingApi::instance() #6 {main}</p>
<p></p>
<p>--------------------------------------------------------------------</p>
<p>Is this my server that has the dodgy time?</p>
<p></p>
<p>Is the upshot of this my hosting server has it's time out of whack?</p>
<p></p>
<p>Cheers</p>
<p>Alex</p> Are you sure it's hanging, or…tag:build.ning.com,2012-05-06:6308082:Comment:165552012-05-06T04:51:25.104ZPhillip Pearsonhttp://build.ning.com/profile/PhillipPearson
<p>Are you sure it's hanging, or is it throwing an exception and killing the request at that point? Try this:</p>
<p>require_once('ning-api-php/NingApi.php');</p>
<p>echo "Fetch Recent Photos..";<br/>// Get the most recent photo<br/>try {<br/> $result = NingApi::instance()->photo->fetchNRecent();<br/> echo "I am back...";<br/> print_r($result);<br/>} catch (Exception $e) {<br/> echo "Error: ".$e->getMessage()."\n".$e->getTraceAsString();<br/>}</p>
<p>Are you sure it's hanging, or is it throwing an exception and killing the request at that point? Try this:</p>
<p>require_once('ning-api-php/NingApi.php');</p>
<p>echo "Fetch Recent Photos..";<br/>// Get the most recent photo<br/>try {<br/> $result = NingApi::instance()->photo->fetchNRecent();<br/> echo "I am back...";<br/> print_r($result);<br/>} catch (Exception $e) {<br/> echo "Error: ".$e->getMessage()."\n".$e->getTraceAsString();<br/>}</p> I did a really simple test.
T…tag:build.ning.com,2012-05-05:6308082:Comment:168242012-05-05T13:37:59.408ZAlex Seymourhttp://build.ning.com/profile/AlexSeymour
<p>I did a really simple test.</p>
<p>Test code is:</p>
<p><br/><em>require_once('ning-api-php/NingApi.php');</em><br/><br/><em>echo "Fetch Recent Photos..";</em><br/><em>// Get the most recent photo</em><br/><em>$result = NingApi::instance()->photo->fetchNRecent();</em><br/><em>echo "I am back...";</em><br/><em>print_r($result);</em><br/><br/></p>
<p>Output I get in my browser is:</p>
<p><em>Fetch Recent Photos..</em></p>
<p>I did a really simple test.</p>
<p>Test code is:</p>
<p><br/><em>require_once('ning-api-php/NingApi.php');</em><br/><br/><em>echo "Fetch Recent Photos..";</em><br/><em>// Get the most recent photo</em><br/><em>$result = NingApi::instance()->photo->fetchNRecent();</em><br/><em>echo "I am back...";</em><br/><em>print_r($result);</em><br/><br/></p>
<p>Output I get in my browser is:</p>
<p><em>Fetch Recent Photos..</em></p> Yes it still hangs.
What wo…tag:build.ning.com,2012-05-05:6308082:Comment:169072012-05-05T12:52:51.062ZAlex Seymourhttp://build.ning.com/profile/AlexSeymour
<p></p>
<p>Yes it still hangs.</p>
<p></p>
<p>What would be the reason for that call to fail?</p>
<p>$result = NingApi::instance()->user->fetch($args );</p>
<p></p>
<p>Alex</p>
<p></p>
<p>Yes it still hangs.</p>
<p></p>
<p>What would be the reason for that call to fail?</p>
<p>$result = NingApi::instance()->user->fetch($args );</p>
<p></p>
<p>Alex</p> Is this problem still happeni…tag:build.ning.com,2012-05-05:6308082:Comment:168212012-05-05T01:09:21.394ZPhillip Pearsonhttp://build.ning.com/profile/PhillipPearson
<p>Is this problem still happening? I just did a quick test and I get an immediate response from the server.</p>
<p>Is this problem still happening? I just did a quick test and I get an immediate response from the server.</p>