Retrieving User ID - Build2024-03-28T12:03:26Zhttp://build.ning.com/forum/topics/retrieving-user-id?feed=yes&xn_auth=noHi Allyson,
Here's an ultra…tag:build.ning.com,2010-11-19:6308082:Comment:6712010-11-19T00:02:57.000ZPhil McCluskeyhttp://build.ning.com/profile/PhilMcCluskey
<p>Hi Allyson,</p>
<p> </p>
<p>Here's an ultra simple example:</p>
<p> </p>
<p><script type="text/javascript"></p>
<p style="padding-left: 30px;">alert(ning.CurrentProfile.fullName);</p>
<p style="padding-left: 30px;">alert(ning.CurrentProfile.photoUrl);</p>
<p></script></p>
<p> </p>
<p>You should be able to prefill the form variables with the values from those variables.</p>
<p> </p>
<p>Thanks,</p>
<p>Phil</p>
<p> </p>
<p> </p>
<p style="padding-left: 30px;"><br></br> <cite>Allyson…</cite></p>
<p>Hi Allyson,</p>
<p> </p>
<p>Here's an ultra simple example:</p>
<p> </p>
<p><script type="text/javascript"></p>
<p style="padding-left: 30px;">alert(ning.CurrentProfile.fullName);</p>
<p style="padding-left: 30px;">alert(ning.CurrentProfile.photoUrl);</p>
<p></script></p>
<p> </p>
<p>You should be able to prefill the form variables with the values from those variables.</p>
<p> </p>
<p>Thanks,</p>
<p>Phil</p>
<p> </p>
<p> </p>
<p style="padding-left: 30px;"><br/> <cite>Allyson Beckers said:</cite></p>
<blockquote cite="http://build.ning.com/forum/topics/retrieving-user-id#6308082Comment667"><div><p>Could I bother you with an example for that JavaScript?</p>
<p>I have a trivia on my network and I want to automatically pull the logged-in user's name and profile URL to submit with their answer. I am new to JS and can't seem to figure it out.</p>
<p>Your help would be much appreciated!</p>
<p><br/> <cite>Phil McCluskey said:</cite></p>
<blockquote cite="http://build.ning.com/forum/topics/retrieving-user-id?page=1&commentId=6308082%3AComment%3A508&x=1#6308082Comment506"><div><p>Hi Ben,</p>
<p> </p>
<p>You can probably also just do this using some javascript. If you view source on a network page and have a look at the ning js object that gets created, it contains a CurrentProfile object which has an id attribute.</p>
<p> </p>
<p>Also, if you just want a link to a signed in user's My Page, you can use /profiles which will redirect them to their actual profile page.</p>
<p> </p>
<p>Thanks,</p>
<p>Phil</p>
</div>
</blockquote>
</div>
</blockquote> Sweet, thanks Phil. This loo…tag:build.ning.com,2010-11-01:6308082:Comment:5082010-11-01T22:02:52.000ZBen Tseitlinhttp://build.ning.com/profile/BenTseitlin
<p>Sweet, thanks Phil. This looks like it could work for me.<br></br> <br></br> <cite>Phil McCluskey said:</cite></p>
<blockquote cite="http://build.ning.com/forum/topics/retrieving-user-id?commentId=6308082%3AComment%3A506&xg_source=msg_com_forum#6308082Comment506"><div><p>Hi Ben,</p>
<p> </p>
<p>You can probably also just do this using some javascript. If you view source on a network page and have a look at the ning js object that gets created, it contains a CurrentProfile object which has an…</p>
</div>
</blockquote>
<p>Sweet, thanks Phil. This looks like it could work for me.<br/> <br/> <cite>Phil McCluskey said:</cite></p>
<blockquote cite="http://build.ning.com/forum/topics/retrieving-user-id?commentId=6308082%3AComment%3A506&xg_source=msg_com_forum#6308082Comment506"><div><p>Hi Ben,</p>
<p> </p>
<p>You can probably also just do this using some javascript. If you view source on a network page and have a look at the ning js object that gets created, it contains a CurrentProfile object which has an id attribute.</p>
<p> </p>
<p>Also, if you just want a link to a signed in user's My Page, you can use /profiles which will redirect them to their actual profile page.</p>
<p> </p>
<p>Thanks,</p>
<p>Phil</p>
</div>
</blockquote> Hi Ben,
You can probably al…tag:build.ning.com,2010-11-01:6308082:Comment:5062010-11-01T21:59:31.000ZPhil McCluskeyhttp://build.ning.com/profile/PhilMcCluskey
<p>Hi Ben,</p>
<p> </p>
<p>You can probably also just do this using some javascript. If you view source on a network page and have a look at the ning js object that gets created, it contains a CurrentProfile object which has an id attribute.</p>
<p> </p>
<p>Also, if you just want a link to a signed in user's My Page, you can use /profiles which will redirect them to their actual profile page.</p>
<p> </p>
<p>Thanks,</p>
<p>Phil</p>
<p>Hi Ben,</p>
<p> </p>
<p>You can probably also just do this using some javascript. If you view source on a network page and have a look at the ning js object that gets created, it contains a CurrentProfile object which has an id attribute.</p>
<p> </p>
<p>Also, if you just want a link to a signed in user's My Page, you can use /profiles which will redirect them to their actual profile page.</p>
<p> </p>
<p>Thanks,</p>
<p>Phil</p> Thanks Devin! So the screen n…tag:build.ning.com,2010-11-01:6308082:Comment:5022010-11-01T21:58:46.000ZBen Tseitlinhttp://build.ning.com/profile/BenTseitlin
<p>Thanks Devin! So the screen name is the one that is used in a user's profile URL?</p>
<p> </p>
<p>Would this be a correct way to grab it?</p>
<p>var userid = GET /User?author=<screenname></p>
<p> </p>
<p><cite>Devin said:</cite></p>
<blockquote cite="http://build.ning.com/forum/topics/retrieving-user-id?commentId=6308082%3AComment%3A499&xg_source=msg_com_forum#6308082Comment499"><div><p>I've already filed a request for the Ning API to make it easier to find the User ID of the…</p>
</div>
</blockquote>
<p>Thanks Devin! So the screen name is the one that is used in a user's profile URL?</p>
<p> </p>
<p>Would this be a correct way to grab it?</p>
<p>var userid = GET /User?author=<screenname></p>
<p> </p>
<p><cite>Devin said:</cite></p>
<blockquote cite="http://build.ning.com/forum/topics/retrieving-user-id?commentId=6308082%3AComment%3A499&xg_source=msg_com_forum#6308082Comment499"><div><p>I've already filed a request for the Ning API to make it easier to find the User ID of the authenticated member.</p>
<p> </p>
<p>The 'userid' variable you are setting via OpenSocial is called a 'screen name' in the Ning API and it is different from the member's ID. This will allow you to make queries using the author parameter:</p>
<p> </p>
<p> GET /User?author=<screenname></p>
<p> </p>
<p>The reason the Ning API has a 'screen name' and a 'user id' is historical. The 'user id' is specific to the Ning Network you are making queries against, while the 'screen name' (also called the Ning ID) is unique to the Ning Platform. We are currently in the process of removing the 'screen name' so the meaning of the field will change over time.</p>
</div>
</blockquote> I've already filed a request…tag:build.ning.com,2010-11-01:6308082:Comment:4992010-11-01T18:04:32.000ZDevinhttp://build.ning.com/profile/Devin
<p>I've already filed a request for the Ning API to make it easier to find the User ID of the authenticated member.</p>
<p> </p>
<p>The 'userid' variable you are setting via OpenSocial is called a 'screenname' in the Ning API. This will allow you to make queries using the author parameter:</p>
<p> </p>
<p> GET /User?author=<screenname></p>
<p> </p>
<p>I've already filed a request for the Ning API to make it easier to find the User ID of the authenticated member.</p>
<p> </p>
<p>The 'userid' variable you are setting via OpenSocial is called a 'screenname' in the Ning API. This will allow you to make queries using the author parameter:</p>
<p> </p>
<p> GET /User?author=<screenname></p>
<p> </p>