Ning API using PHP to retrieve list of Photos - Build2024-03-29T14:37:41Zhttp://build.ning.com/forum/topics/ning-api-using-php-to-retrieve?commentId=6308082%3AComment%3A14510&x=1&feed=yes&xn_auth=noBut which time is my local co…tag:build.ning.com,2011-11-23:6308082:Comment:145102011-11-23T18:30:31.311Zroihttp://build.ning.com/profile/roi
<p>But which time is my local computer off by ? In comparison to the server time? OR whose time? I tried increasing my local clock but no different. I still get the error <br></br> Error: <b>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: 1322072573-1322073174</b></p>
<p>I'm using the wordpress plugin....</p>
<p> </p>
<p>Thanks </p>
<p><br></br> <cite>Devin said:…</cite></p>
<p>But which time is my local computer off by ? In comparison to the server time? OR whose time? I tried increasing my local clock but no different. I still get the error <br/> Error: <b>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: 1322072573-1322073174</b></p>
<p>I'm using the wordpress plugin....</p>
<p> </p>
<p>Thanks </p>
<p><br/> <cite>Devin said:</cite></p>
<blockquote cite="http://build.ning.com/forum/topics/ning-api-using-php-to-retrieve?commentId=6308082%3AComment%3A3105&xg_source=activity#6308082Comment3204"><div><div class="xg_user_generated"><p>This error is generally caused when your local computer's time is more than five minutes off. I believe Windows has an option to update the time via the Internet. Try that option or try manually updating it.</p>
<p>The server disregards any old requests and uses the oauth_timestamp parameter to determine it.</p>
</div>
</div>
</blockquote> Hey guys im also trying to re…tag:build.ning.com,2011-06-22:6308082:Comment:52452011-06-22T14:12:05.597ZVincenthttp://build.ning.com/profile/Vincent
<p>Hey guys im also trying to retrieve photos for a specific user</p>
<p>And honestly Im struggling... being a new Ning user and all ...(sigh)</p>
<p> </p>
<p>I'd appreciate if possible from you guys, a php code snippet.</p>
<p>I read the information in the links that devin provided but i fail to translate it to php code.</p>
<p> </p>
<p>Thanks in advance....</p>
<p>Hey guys im also trying to retrieve photos for a specific user</p>
<p>And honestly Im struggling... being a new Ning user and all ...(sigh)</p>
<p> </p>
<p>I'd appreciate if possible from you guys, a php code snippet.</p>
<p>I read the information in the links that devin provided but i fail to translate it to php code.</p>
<p> </p>
<p>Thanks in advance....</p> Generally that error means th…tag:build.ning.com,2011-04-20:6308082:Comment:31362011-04-20T16:37:32.918ZDevinhttp://build.ning.com/profile/Devin
Generally that error means that cURL can't find the file at the location you have specified. Check that the full path to the image is an absolute path and it's a valid location.
Generally that error means that cURL can't find the file at the location you have specified. Check that the full path to the image is an absolute path and it's a valid location. Here is the code which I use:…tag:build.ning.com,2011-04-15:6308082:Comment:30242011-04-15T06:31:14.620Zliyamahendra4http://build.ning.com/profile/liyamahendra4
<p>Here is the code which I use:</p>
<p> </p>
<p>if (file_exists("upload/" . $_FILES["file"]["name"]))<br></br> {<br></br> echo $_FILES["file"]["name"] . " already exists. ";<br></br> }<br></br> else<br></br> {<br></br> move_uploaded_file($_FILES["file"]["tmp_name"],<br></br> "upload/" . $_FILES["file"]["name"]);<br></br> echo "Stored in: " . "upload/" . $_FILES["file"]["name"];<br></br> echo "Full path of the…</p>
<p>Here is the code which I use:</p>
<p> </p>
<p>if (file_exists("upload/" . $_FILES["file"]["name"]))<br/> {<br/> echo $_FILES["file"]["name"] . " already exists. ";<br/> }<br/> else<br/> {<br/> move_uploaded_file($_FILES["file"]["tmp_name"],<br/> "upload/" . $_FILES["file"]["name"]);<br/> echo "Stored in: " . "upload/" . $_FILES["file"]["name"];<br/> echo "Full path of the image: " .realpath('./upload/') .'\\' .$_FILES["file"]["name"];<br/> $imagePath = realpath('upload/') .'/' .$_FILES["file"]["name"];<br/> echo " Imagepath is : " .$imagePath;<br/> <br/> // Ning Code<br/> // --------------<br/> <br/> require_once('NingApi.php');<br/> $subdomain = "myningdomain";<br/> $consumer_key = "my_key";<br/> $consumer_secret = "my_secret";<br/> $access_token = "";<br/> $access_token_secret = "";<br/> <br/> $ningApi = new NingApi($subdomain, $consumer_key, $consumer_secret);<br/> $email = $_REQUEST["emailaddress"];<br/> $password = $_REQUEST["password"] ;<br/> <br/> $loginMessage = "";<br/> try<br/> {<br/> $result = $ningApi->login($email, $password);<br/> $loginMessage = "success";<br/> }<br/> catch(Exception $e)<br/> {<br/> $loginMessage = $e.getMessage();<br/> }<br/> <br/><br/> $parts = array(<br/> "title" => "My test photo",<br/> "description" => "This is a test photo",<br/> "file" => $imagePath<br/> );<br/> <br/> // Create a new photo<br/> $result = NingApi::instance()->photo->create($parts);<br/> <br/> print_r($result);<br/> <br/> print "Ning upload complete";<br/> <br/> }</p>
<p> </p>
<p>----------------------------------</p>
<p>The exact error is :</p>
<p> </p>
<p><b>Fatal error</b>: Uncaught cURL error: failed creating formpost data thrown in "myfile_name" at line 208.</p>
<p> </p>
<p>Can you help me with this error?</p>
<p> </p>
<p>Thanks in advance.</p> Hello Devin,
I tried the ex…tag:build.ning.com,2011-04-13:6308082:Comment:30232011-04-13T14:11:38.036Zliyamahendra4http://build.ning.com/profile/liyamahendra4
<p>Hello Devin,</p>
<p> </p>
<p>I tried the example given in the documentation for uploading file using Ning API using PHP.</p>
<p> </p>
<p>Yes, earlier I was not using the "@" sign and was getting this "Bad Photo" error. However, after including the "@" symbol, now I am landing into a new error which says "Curl cannot create form data".</p>
<p> </p>
<p>Do you have any idea where am I making a mistake?</p>
<p> </p>
<p>Thanks.</p>
<p>Hello Devin,</p>
<p> </p>
<p>I tried the example given in the documentation for uploading file using Ning API using PHP.</p>
<p> </p>
<p>Yes, earlier I was not using the "@" sign and was getting this "Bad Photo" error. However, after including the "@" symbol, now I am landing into a new error which says "Curl cannot create form data".</p>
<p> </p>
<p>Do you have any idea where am I making a mistake?</p>
<p> </p>
<p>Thanks.</p> I believe you are using the N…tag:build.ning.com,2011-04-12:6308082:Comment:30222011-04-12T16:26:05.139ZDevinhttp://build.ning.com/profile/Devin
I believe you are using the <a href="https://github.com/ning/ning-api-php" target="_blank">Ning API PHP library</a>. If so, make sure that you being the path to your file with an @. This tells PHP to include the contents of the specified file. Without it, the PHP code will try to upload a string that contains the path to file instead of the file itself. Checkout the <a href="http://developer.ning.com/docs/ningapi/1.0/examples/php/php.html#add-a-new-photo" target="_blank">adding a photo with the…</a>
I believe you are using the <a href="https://github.com/ning/ning-api-php" target="_blank">Ning API PHP library</a>. If so, make sure that you being the path to your file with an @. This tells PHP to include the contents of the specified file. Without it, the PHP code will try to upload a string that contains the path to file instead of the file itself. Checkout the <a href="http://developer.ning.com/docs/ningapi/1.0/examples/php/php.html#add-a-new-photo" target="_blank">adding a photo with the Ning API PHP library</a> for an example. I wrote some PHP code to uplo…tag:build.ning.com,2011-04-10:6308082:Comment:31252011-04-10T12:07:11.063Zliyamahendra4http://build.ning.com/profile/liyamahendra4
<p>I wrote some PHP code to upload a file to my Ning network.</p>
<p> </p>
<p>However, the file get uploaded to my PHP server but when the code for uploading the image to my ning network gets executed, I get the following error:</p>
<p> </p>
<p><b>Fatal error</b>: Uncaught Bad photo. (400) 5-10 thrown in <b>C:\wamp\www\ning\NingException.php</b> on line <b>56</b></p>
<p> </p>
<p><b>Do you have any idea what could be wrong? How can I solve this error?</b></p>
<p> </p>
<p><b>Thanks in…</b></p>
<p>I wrote some PHP code to upload a file to my Ning network.</p>
<p> </p>
<p>However, the file get uploaded to my PHP server but when the code for uploading the image to my ning network gets executed, I get the following error:</p>
<p> </p>
<p><b>Fatal error</b>: Uncaught Bad photo. (400) 5-10 thrown in <b>C:\wamp\www\ning\NingException.php</b> on line <b>56</b></p>
<p> </p>
<p><b>Do you have any idea what could be wrong? How can I solve this error?</b></p>
<p> </p>
<p><b>Thanks in advance.<br/></b></p> Hey Devin,
The oauth error…tag:build.ning.com,2011-04-07:6308082:Comment:33052011-04-07T11:27:23.838Zliyamahendra4http://build.ning.com/profile/liyamahendra4
<p>Hey Devin,</p>
<p> </p>
<p>The oauth error got solved. Yes, may be it was a time difference error.</p>
<p> </p>
<p>Referring to question no. 3 asked by me, the details are like this.</p>
<p> </p>
<p>I use my email address and password along with the consumer key and consumer secret. This returns me access token and access secret token. From my past experience with twitter app on android, I believe that reusing the obtained access tokens should work in subsequent…</p>
<p>Hey Devin,</p>
<p> </p>
<p>The oauth error got solved. Yes, may be it was a time difference error.</p>
<p> </p>
<p>Referring to question no. 3 asked by me, the details are like this.</p>
<p> </p>
<p>I use my email address and password along with the consumer key and consumer secret. This returns me access token and access secret token. From my past experience with twitter app on android, I believe that reusing the obtained access tokens should work in subsequent requests.</p>
<p> </p>
<p>When I try to do so, it gives me following error:</p>
<p> </p>
<p><strong><em><font size="1">Fatal error: Uncaught Invalid username (401) 1-23 thrown in C:\wamp\www\ning\NingException.php on line 56</font></em></strong></p>
<p> </p>
<p><font size="1">Do you have any idea about this error?</font></p>
<p> </p>
<p><font size="1">Thanks.</font></p>
<p><font size="1">Mahendra.<br/></font></p>
<p> </p>
<p><font size="1"><i><br/></i></font></p> This error is generally cause…tag:build.ning.com,2011-04-05:6308082:Comment:32042011-04-05T23:51:25.073ZDevinhttp://build.ning.com/profile/Devin
<p>This error is generally caused when your local computer's time is more than five minutes off. I believe Windows has an option to update the time via the Internet. Try that option or try manually updating it.</p>
<p>The server disregards any old requests and uses the oauth_timestamp parameter to determine it.</p>
<p>This error is generally caused when your local computer's time is more than five minutes off. I believe Windows has an option to update the time via the Internet. Try that option or try manually updating it.</p>
<p>The server disregards any old requests and uses the oauth_timestamp parameter to determine it.</p> Hello Devin,
Firstly, thank y…tag:build.ning.com,2011-04-02:6308082:Comment:31052011-04-02T08:27:51.296Zliyamahendra4http://build.ning.com/profile/liyamahendra4
<p>Hello Devin,</p>
<p>Firstly, thank you for taking time to reply my question.</p>
<p>I tried testing with your suggestion. However, to my surprise my earlier code which was working and giving results now shows an oauth error.</p>
<p>The error is : "<b>Fatal error</b>: Uncaught 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: 1301732382-1301732983 (401) 1-14 thrown in…</p>
<p>Hello Devin,</p>
<p>Firstly, thank you for taking time to reply my question.</p>
<p>I tried testing with your suggestion. However, to my surprise my earlier code which was working and giving results now shows an oauth error.</p>
<p>The error is : "<b>Fatal error</b>: Uncaught 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: 1301732382-1301732983 (401) 1-14 thrown in <b>C:\wamp\www\ning\NingException.php</b> on line <b>56"</b></p>
<p> </p>
<p>Do you have any idea about this error?</p>
<p> </p>
<p>Thanks,</p>
<p>Mahendra.</p>