• Hi,

    Thanks for writing and giving so much feedback. I'm starting with the easiest question first.

    The URI for the Status API is http://social.yahooapis.com/v1/user/{guid}/presence/presence.

    I looked at a test application to confirm the correct URL for the Status API, and if you take a look at the method
    CODE
    getPresence()
    in the PHP SDK, you will find this URL as well.

    I think using the names Status and Presence is confusing though, so I can understand why you would ask this question. The best I can say is to think of using the Status API to get a user's presence (status message).



    0
  • YAP > YML
    http://developer.yahoo.com/yap/yml/index.html page
    yml:visible-to-owner
    yml:visible-to-user

    Both items linked to the same page
    http://developer.yahoo.com/yap/yml/visible-to-user.html
    0
  • QUOTE (vivaty.menlopark @ Nov 24 2008, 10:57 AM) <{POST_SNAPBACK}>
    YAP > YML
    http://developer.yahoo.com/yap/yml/index.html page
    yml:visible-to-owner
    yml:visible-to-user

    Both items linked to the same page
    http://developer.yahoo.com/yap/yml/visible-to-user.html
    0
  • QUOTE (vivaty.menlopark @ Nov 24 2008, 10:57 AM) <{POST_SNAPBACK}>
    YAP > YML
    http://developer.yahoo.com/yap/yml/index.html page
    yml:visible-to-owner
    yml:visible-to-user

    Both items linked to the same page
    http://developer.yahoo.com/yap/yml/visible-to-user.html


    This is a doc bug, which I'll fix. Thanks for pointing it out. -- Dale
    0
  • Social Directory API > Updates API > Single Update
    http://developer.yahoo.com/social/rest_api...e-resource.html
    Use this URI to insert, modify, or delete an update for a particular user.

    Questions:
    1) Is that a mistake that the URI are the same for 3 different operations GET (insert), PUT (edit), and DELETE (delete)?
    2) If not, can you give clear examples on how to do this properly in GET, PUT, DELETE, give a more detail sample application?
    3) Your current documentation is not detail enough to demonstrate the "how-to". There is too much guessing involved here.

    (Copy & Paste from documentation)
    Example JSON Response Body for GET
    This example gets the update posted by the user specified by the GUID "U7KVXD6ZBCOTL2IFLQH3M5KOIA". The source of the update is APP.-yossd3e.
    CODE
    http://social.yahooapis.com/v1/user/U7KVXD6ZBCOTL2IFLQH3M5KOIA/updates/APP.-yossd3e/appInstallSuid1?format=json


    Example JSON Request Body for PUT
    An example of the insert update data on a HTTP PUT:
    CODE
    http://social.yahooapis.com/v1/user/U7KVXD6ZBCOTL2IFLQH3M5KOIA/updates/APP.-yossd3e/appInstallSuid1?format=json


    Example JSON Response Body for DELETE
    A sample call for DELETE:
    CODE
    http://social.yahooapis.com/v1/user/U7KVXD6ZBCOTL2IFLQH3M5KOIA/updates/APP.-yossd3e/appInstallSuid1?format=json
    0
  • Hi

    QUOTE
    1) Is that a mistake that the URI are the same for 3 different operations GET (insert), PUT (edit), and DELETE (delete)?


    Actually, you do use the same URI for the three different HTTP methods. The HTTP method is defined in the header when you make a REST call, so the URI does not change. Most scripting languages have methods to define the HTTP method when making a REST call; you can use the cURL library to specify the HTTP method if you are using PHP. The easiest way to retrieve and modify data using the Social APIs is to use the PHP SDK, which has built-in methods that make the REST calls for you.

    QUOTE
    2) If not, can you give clear examples on how to do this properly in GET, PUT, DELETE, give a more detail sample application?


    The YSP API Reference is merely for reference and not intended to instruct developers how to make REST calls. I would suggest that you look at the PHP SDK documentation, which has examples and a tutorial, or look at one of the YDN Language Centers, which have information about making REST calls.

    1. PHP SDK for YSP
    2. Making REST Calls with PHP
    3. Making REST Calls with Ruby
    4. Making Rest Calls with Python


    QUOTE (vivaty.menlopark @ Nov 24 2008, 10:59 AM) <{POST_SNAPBACK}>
    Social Directory API > Updates API > Single Update
    http://developer.yahoo.com/social/rest_api...e-resource.html
    Use this URI to insert, modify, or delete an update for a particular user.

    Questions:
    1) Is that a mistake that the URI are the same for 3 different operations GET (insert), PUT (edit), and DELETE (delete)?
    2) If not, can you give clear examples on how to do this properly in GET, PUT, DELETE, give a more detail sample application?
    3) Your current documentation is not detail enough to demonstrate the "how-to". There is too much guessing involved here.

    (Copy & Paste from documentation)
    Example JSON Response Body for GET
    This example gets the update posted by the user specified by the GUID "U7KVXD6ZBCOTL2IFLQH3M5KOIA". The source of the update is APP.-yossd3e.
    CODE
    http://social.yahooapis.com/v1/user/U7KVXD6ZBCOTL2IFLQH3M5KOIA/updates/APP.-yossd3e/appInstallSuid1?format=json


    Example JSON Request Body for PUT
    An example of the insert update data on a HTTP PUT:
    CODE
    http://social.yahooapis.com/v1/user/U7KVXD6ZBCOTL2IFLQH3M5KOIA/updates/APP.-yossd3e/appInstallSuid1?format=json


    Example JSON Response Body for DELETE
    A sample call for DELETE:
    CODE
    http://social.yahooapis.com/v1/user/U7KVXD6ZBCOTL2IFLQH3M5KOIA/updates/APP.-yossd3e/appInstallSuid1?format=json
    0
  • YAP > Status API
    http://developer.yahoo.com/social/rest_api...e-resource.html

    Are these errors?
    1) Example JSON Request Body for PUT is not matching the above Syntax
    2) Missing the section for Example XML Response Body for GET

    (Copy & Paste from Documentation)
    JSON Syntax for PUT
    CODE
    {
    "starttime": "Date",
    "endtime": "Date",
    "status": "text",
    }


    Example JSON Request Body for PUT
    CODE
    {
    “status”: “Reading paper”
    }
    0
  • Thanks, for pointing that out. I will modify the documentation, which will reflect the change either this or next week.


    QUOTE (vivaty.menlopark @ Nov 24 2008, 11:01 AM) <{POST_SNAPBACK}>
    YAP > Status API
    http://developer.yahoo.com/social/rest_api...e-resource.html

    Are these errors?
    1) Example JSON Request Body for PUT is not matching the above Syntax
    2) Missing the section for Example XML Response Body for GET

    (Copy & Paste from Documentation)
    JSON Syntax for PUT
    CODE
    {
    "starttime": "Date",
    "endtime": "Date",
    "status": "text",
    }


    Example JSON Request Body for PUT
    CODE
    {
    “status”: “Reading paper”
    }
    0
  • YML yml:a
    http://developer.yahoo.com/yap/yml/a.html

    Possible error?
    Both attribute description are the same.

    Attribute replace
    replace string optional The ID of a DOM node whose contents will be replaced with the output of the view/params specified.
    Attribute insert
    insert string optional The ID of a DOM node whose contents will be replaced with the output of the view/params specified.

    Possible error?
    Your attribute description stated the allowed values are "YahooFullView" and "YahooSmallView". Your example use ="my_external_view". Is your description contain error or your example code?
    <yml:a params="/path/to/the/page.php?a=b" view="my_external_view">Get more stuff</yml:a>

    Problems:
    I couldn't figure out how to use insert and replace from your example code. I couldn't get yml:a to show and hide text by adding <div>. If I use <yml:a view="YahooFullView" replace="output">, I couldn't call 2nd Application URL to replace on YahooFullView because each app only allow to submit a single application ID. It seems like there are something missing. It is not clear enough how to use insert and replace.

    Attribute view
    Name of application view, or developer hosted application page, to link to. The allowed values for application view are "YahooFullView" and "YahooSmallView".
    0
  • QUOTE (vivaty.menlopark @ Nov 24 2008, 11:01 AM) <{POST_SNAPBACK}>
    YML yml:a
    http://developer.yahoo.com/yap/yml/a.html

    Possible error?
    Both attribute description are the same.

    Attribute replace
    replace string optional The ID of a DOM node whose contents will be replaced with the output of the view/params specified.
    Attribute insert
    insert string optional The ID of a DOM node whose contents will be replaced with the output of the view/params specified.

    Possible error?
    Your attribute description stated the allowed values are "YahooFullView" and "YahooSmallView". Your example use ="my_external_view". Is your description contain error or your example code?
    <yml:a params="/path/to/the/page.php?a=b" view="my_external_view">Get more stuff</yml:a>

    Problems:
    I couldn't figure out how to use insert and replace from your example code. I couldn't get yml:a to show and hide text by adding <div>. If I use <yml:a view="YahooFullView" replace="output">, I couldn't call 2nd Application URL to replace on YahooFullView because each app only allow to submit a single application ID. It seems like there are something missing. It is not clear enough how to use insert and replace.

    Attribute view
    Name of application view, or developer hosted application page, to link to. The allowed values for application view are "YahooFullView" and "YahooSmallView".


    Yes, those items you pointed out are doc errors. Thanks again. I'll fix them. Regarding your description following "Problems," we are working on some better examples, but they aren't ready yet.
    0
  • Thanks for responding and explaining so it help us to debug and remove the documentation errors to avoid confusion.

    Those links are very useful b/c I couldn't find those documentation in the last 2 weeks.
    0
  • No problem. Thank you for helping us improve the documentation. The landing page for the Y!OS documentation will be modified in the future to improve the navigation, which should help developers find relevant documents.


    QUOTE (vivaty.menlopark @ Nov 25 2008, 10:53 AM) <{POST_SNAPBACK}>
    Thanks for responding and explaining so it help us to debug and remove the documentation errors to avoid confusion.

    Those links are very useful b/c I couldn't find those documentation in the last 2 weeks.
    0
  • YAP > OAuth
    http://developer.yahoo.com/oauth/guide/oauth-auth-flow.html

    Get a Request Token (get_request_token)
    https://api.login.yahoo.com/oauth/v2/
    get_request_token?oauth_nonce=ce2130523f788f313f76314ed3965ea6
    &oauth_timestamp=1202956957
    &oauth_consumer_key=123456891011121314151617181920
    &oauth_signature_method=plaintext
    &oauth_signature=abcdef
    &oauth_version=1.0
    &xoauth_lang_pref="en-us"

    Are these errors?
    1) I don't see a Request Parameter [Consumer Secret ] on the list
    2) If not, it is applying oauth_consumer_key, I don't see the %26 at the end of Consumer Secret
    3) I don't see the %26 on the sample request code at
    http://developer.yahoo.com/oauth/guide/oau...ke-request.html
    4) If the sample code is using plaintext as oauth_signature_method so the instruction is to include %26, but where?

    (Copy & Paste from Documentation)
    Table 1. Request Token (get_request_token) Request Parameters
    Request Parameter
    oauth_signature
    Description
    The Consumer Secret that was issued to the application. If you are using the PLAINTEXT signature method, add %26 at the end of the Consumer Secret. For more information about signing requests, refer to Signing Requests to Yahoo!.
    0
  • Sorry. I found Consumer Secret as oauth_signature.

    But still find no %26 using plaintext method.

    http://developer.yahoo.com/oauth/guide/oau...ke-request.html is good because it is using HMAC-SHA1 as oauth_signature_method.
    0
  • YAP > OAuth
    http://developer.yahoo.com/oauth/guide/oauth-auth-flow.html

    Is that error?
    Missing & on line 4
    CODE
    https://api.login.yahoo.com/oauth/v2/get_token?oauth_nonce=ef3a091928d5491624c0ac54d697124422705091   
    &oauth_consumer_key=123456891011121314151617181920
    &oauth_signature_method=plaintext
    &oauth_signature=55d4cf6bf417023ce5dcc3b77132fb021cd13b21abcdef%26
    &oauth_version=1.0
    &oauth_token=AJwxz0eyXRa._q0xKlggmMSpQzYjOZyqApyhHybqPzCsDr0-
    &oauth_timestamp=1204762971
    &oauth_session_handle=ALKVBsl8DHR1rsAHSwTmAxYIsIGs3l31syRaA_aaF.RDs.MknmVM4P


    Table 6. Refresh Access Token (get_token) Request Parameters
    oauth_signature
    The concatenated Consumer Secret and Token Secret separated by an "&" character. For more information about signing requests, refer to Signing Requests to Yahoo!.

    This refer to another reference link here

    Signing Requests to Yahoo!
    http://developer.yahoo.com/oauth/guide/oauth-signing.html
    line 8
    &oauth_signature=PnW34DmC0kPTYYD4lNPVbY3%2BF5A%3D

    Is this an error?
    missing &

    (Copy & Paste from Documentation)
    Signing Requests using PLAINTEXT
    To create the oauth_signature parameter for PLAINTEXT signatures, simply concatenate the Consumer Secret and Token Secret separated by an "&" character.

    Note
    For requests to get_request_token, the Token Secret Is absent. Include only the Consumer Secret followed by an "&" character.
    0
  • QUOTE (vivaty.menlopark @ Nov 25 2008, 06:28 PM) <{POST_SNAPBACK}>
    YAP > OAuth
    http://developer.yahoo.com/oauth/guide/oauth-auth-flow.html

    Is that error?
    Missing & on line 4

    This is not an error, since %26 is the URL encoded equivalent of the ampersand (&) symbol.

    QUOTE (vivaty.menlopark @ Nov 25 2008, 06:28 PM) <{POST_SNAPBACK}>
    This refer to another reference link here

    I'm not sure what you mean by the above comment. Can you rephrase? :)I don't think this is a mistake. I think you are confusing PLAINTEXT and HMAC-SHA1, since the ampersand & symbol is only visible if you are using PLAINTEXT encoding. The code above is using HMAC-SHA1.
    0
  • QUOTE (JB @ Dec 1 2008, 04:31 PM) <{POST_SNAPBACK}>
    This is not an error, since %26 is the URL encoded equivalent of the ampersand (&) symbol.


    I'm not sure what you mean by the above comment. Can you rephrase? :)This is a mistake on documentation sample code. I go back and forth to check each sample code, zoom into the method.
    0
  • Suggestion:
    Use the same oauth_consumer_key, oauth_signature, etc on the sample code on the same page. Consistency will help to follow the sample code.
    0
  • YAP > YML > yml:form
    http://developer.yahoo.com/yap/yml/form.html

    Missing example

    This is urgent...

    Is this possible that you can put a very simple example to demonstrate how to use yml:form Attributes? This would save so much time to guess and trial.
    0
  • QUOTE (vivaty.menlopark @ Nov 26 2008, 03:03 PM) <{POST_SNAPBACK}>
    YAP > YML > yml:form
    http://developer.yahoo.com/yap/yml/form.html

    Missing example

    This is urgent...

    Is this possible that you can put a very simple example to demonstrate how to use yml:form Attributes? This would save so much time to guess and trial.


    Here's a small example. Hope it's adequate for your needs:
    <yml:form name="myform" view="YahooFullView" params="yml_form1.php" method="POST">
    0
  • YDN PHP SDK Guide for Yahoo! Social Platform My Social Tutorial
    My Social Tutorial
    http://developer.yahoo.com/social/php_guid...l_tutorial.html

    Error here:
    require_once("YourDirectory/yosdk/libYahoo.inc");

    It should be
    require_once("YourDirectory/yosdk/lib/Yahoo.inc");
    0
  • YDN PHP SDK Guide for Yahoo! Social Platform My Social Tutorial
    My Social Tutorial
    http://developer.yahoo.com/social/php_guid...l_tutorial.html

    Sample code errors!
    on last section: Your First Script with the PHP SDK

    Error Message when render at Yahoo Canvas View
    CODE
    Vivaty's Contacts:
    Notice: Trying to get property of non-object in /var/www/html/yahoo/mysocial_ini.php on line 59
    Notice: Trying to get property of non-object in /var/www/html/yahoo/mysocial_ini.php on line 59
    repeat...

    Vivaty's Connections:
    Notice: Undefined property: stdClass::$imageUrl in /var/www/html/yahoo/mysocial_ini.php on line 81
    Notice: Undefined property: stdClass::$status in /var/www/html/yahoo/mysocial_ini.php on line 82
    repeat...

    Vivaty's Status Message:
    stdClass Object ( [id] => 6212273029826762841 [starttime] => 2008-11-21T21:29:42Z [endtime] => [src] => yahoo [value] => stdClass Object ( [status] => Even refreshing the page won't update the updates box streaming... Let me View All ) )
    0
  • YDN PHP SDK Guide for Yahoo! Social Platform My Social Tutorial
    My Social Tutorial
    http://developer.yahoo.com/social/php_guid...l_tutorial.html

    Sample code errors!
    on last section: This is the link to the source code
    http://developer.yahoo.com/social/php_guid...s/mysocial.phps

    Error Message when render at Yahoo Canvas View
    Vivaty's Contacts:
    Notice: Trying to get property of non-object in /var/www/html/yahoo/mysocial.php on line 54
    Notice: Trying to get property of non-object in /var/www/html/yahoo/mysocial.php on line 54
    repeat...

    Vivaty's Connections:
    Notice: Undefined property: stdClass::$imageUrl in /var/www/html/yahoo/mysocial.php on line 73
    Notice: Undefined property: stdClass::$status in /var/www/html/yahoo/mysocial.php on line 74
    repeat...

    Vivaty's Status Message:
    stdClass Object ( [id] => 6212273029826762841 [starttime] => 2008-11-21T21:29:42Z [endtime] => [src] => yahoo [value] => stdClass Object ( [status] => Even refreshing the page won't update the updates box streaming... Let me View All ) )
    0
  • Is it possible that YOS team to double check your sample code before you check into the Documentation?

    We developers can't afford our development time in time crunch to QA & audit your sample code and examples.
    0


  • I am using quote so you can find the link as forum shorten the http url in plain text.
    0
  • Fatal error: Call to undefined method YahooUser::getContactByGuid() in /var/www/html/yahoo/mysocial.php on line 47

    CODE
    // To get a specific contact, pass the contact's GUID to the method getContactsByGuid  
    echo "<hr /><h2>$nickname's Single Contact:</h2>";
    $contact_guid = "CBZF4XRGYWPT34LSHUN4TYFFAY";
    $user_contact = $yahoo_user->getContactByGuid($contact_guid);
    print("<div>");
    print(strval($contact_guid));
    print("</div>");


    This fail when I follow your sample code using the single contact.

    It seems like your PHP SDK is not supporting this API? Is your sample code is out of date? not syn with latest PHP SDK?
    0
  • YDN PHP SDK Guide for Yahoo! Social Platform Using YQL with the PHP SDK
    Using YQL with the PHP SDK
    To show the entire URL
    CODE
    http://developer.yahoo.com/social/php_guide/sdk_yql-using_yql.html


    1) Remove unacceptable tag like html, body on code sample in Canvas View
    To show the entire URL
    CODE
    http://developer.yahoo.com/social/php_guide/examples/php_sdk_yql_example.phps

    <pre>
    CODE
    <?php
    // Do the call
    foreach($api_queries as $api=>$query) {
    echo "<h2>$api Data</h2>";
    var_dump($session->query($query));
    echo "<br />";
    }
    ?>
    </pre>


    2) Should mention using Open Application key and secret, not the OAuth Application key and secret
    define(CONSUMER_KEY,"xxx");
    define(CONSUMER_SECRET,"xxx");
    0
  • Hi vivaty.menlopark,

    Since there are a number of posts here...I'm going to list off responses to some of the action items based on your post #:

    Post #22
    This is a valid concern in the sample code but this is a superficial change. Since the directory path to the SDK is on a user’s server, this path will be changed anyways – this will not affect development but I have sent this same information to the docs team so they will probably revise this in the next docs iteration.

    Post #23 & 24
    This code sample works perfectly for me. I think this error might come up if you have no contacts or connections (but that's just a guess). Can you verify whether you do have contacts / connections please. With that information we'll take another look.

    Post #27
    getContactbyGuid is no longer a method in the SDK. I've sent this same note to the docs team that on http://developer.yahoo.com/social/php_guid...l_tutorial.html under “Getting User Contacts”, references to the getContactByGuid method should be removed.

    Post #29
    #1 – This process seems to work fine for me
    #2 – There is an issue with the sample code for this one. Info sent to the docs team as well. On http://developer.yahoo.com/social/php_guid...-using_yql.html under “Querying Private Data” #2 the code needs to be updated.

    #2 code sample should work if it's the following:

    CODE
    // Define YQL queries for the Social Directory APIs  
    $profile = "select * from social.profile where guid=me";
    $contacts = "select fields.value from social.contacts where guid=me";
    $connections = "select * from social.connections where owner_guid=me";
    $updates = "select * from social.updates where guid=me";
    $status = "select value.status from social.presence where guid=me";

    $api_queries = array("Profiles"=>$profile,"Contacts"=>$contacts,"Connections"=>$connections,
    "Updates"=>$updates,"Presence"=>$status);



    Thank you for taking an interest in helping us build a better system for all developers, and we very much appreciate that you are taking the time to voice your concerns on the forum. I just wished to note that the Y!OS forums are generally moderated by the same people that have built and/or use the platform internally. These teams are working diligently to upgrade the platform with new features, fix bugs assigned in their queues and provide developer help on top of that. We understand your frustration if you're in a time crunch and need immediate responses, but it does take us a moderate amount of time to see your questions, test your code samples / doc changes, inform the appropriate departments and then respond. We appreciate your patience and will do our best to help you as best we can.

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network
    0
  • Post #22
    Agree it is superficial. However it should be corrected. Other superficial errors can be harmful if a beginner developer just copy and paste the code like I did.

    Post #23
    I confirmed that Canvas View won't allow you to define key and secret this way
    define(CONSUMER_KEY,"xxx");
    define(CONSUMER_SECRET,"xxx");
    This define statement will cause errors.

    Even I use a safer way to define the key and secret, I am still getting the same error reported on Post#23
    $consumerKey = "xxx"
    $consumerKeySecret = "xxx"

    Note: I do have Contacts, Connections, and Status Message in my Yahoo Profile. I was able to pull the data array via PHP SDK and YQL. In short your mysocial.php sample code is not working. After rendering the $user_profile & $user_updates, it failed on parsing the arrays $user_contacts and the rest.

    Post #27
    If getContactbyGuid is no longer a method in the SDK, can you check if the sample code here is correct and valid?
    $user_contacts = $yahoo_user->getContacts();
    foreach($user_contacts as $contact)....
    I couldn't parse any contact in this array

    Post #29
    See my fixes on Post #31. You are welcome to use my code in your sample code. You need to limit on the data within the buffer.

    Thank you part
    Yahoo Open Social container is the most restricted among Open Social containers. In order to get a very complex commercial application to run, I rather spend the development time to build a better app that run better on Yahoo platform than debugging and double checking your sample code and SDK on documentation. Or spend the time to re-architect the application to run on Yahoo platform. At startup mode, we'll need to justify our development time. Reasonable timely responses on critical bugs are necessary.

    QUOTE (Jon @ Dec 2 2008, 12:46 PM) <{POST_SNAPBACK}>
    Hi vivaty.menlopark,

    Since there are a number of posts here...I'm going to list off responses to some of the action items based on your post #:

    Post #22
    This is a valid concern in the sample code but this is a superficial change. Since the directory path to the SDK is on a user’s server, this path will be changed anyways – this will not affect development but I have sent this same information to the docs team so they will probably revise this in the next docs iteration.

    Post #23 & 24
    This code sample works perfectly for me. I think this error might come up if you have no contacts or connections (but that's just a guess). Can you verify whether you do have contacts / connections please. With that information we'll take another look.

    Post #27
    getContactbyGuid is no longer a method in the SDK. I've sent this same note to the docs team that on http://developer.yahoo.com/social/php_guid...l_tutorial.html under “Getting User Contacts”, references to the getContactByGuid method should be removed.

    Post #29
    #1 – This process seems to work fine for me
    #2 – There is an issue with the sample code for this one. Info sent to the docs team as well. On http://developer.yahoo.com/social/php_guid...-using_yql.html under “Querying Private Data” #2 the code needs to be updated.

    #2 code sample should work if it's the following:

    CODE
    // Define YQL queries for the Social Directory APIs  
    $profile = "select * from social.profile where guid=me";
    $contacts = "select fields.value from social.contacts where guid=me";
    $connections = "select * from social.connections where owner_guid=me";
    $updates = "select * from social.updates where guid=me";
    $status = "select value.status from social.presence where guid=me";

    $api_queries = array("Profiles"=>$profile,"Contacts"=>$contacts,"Connections"=>$connections,
    "Updates"=>$updates,"Presence"=>$status);



    Thank you for taking an interest in helping us build a better system for all developers, and we very much appreciate that you are taking the time to voice your concerns on the forum. I just wished to note that the Y!OS forums are generally moderated by the same people that have built and/or use the platform internally. These teams are working diligently to upgrade the platform with new features, fix bugs assigned in their queues and provide developer help on top of that. We understand your frustration if you're in a time crunch and need immediate responses, but it does take us a moderate amount of time to see your questions, test your code samples / doc changes, inform the appropriate departments and then respond. We appreciate your patience and will do our best to help you as best we can.

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network
    0
  • QUOTE
    QUOTE (vivaty.menlopark @ Dec 2 2008, 02:31 PM) <{POST_SNAPBACK}>

    Post #22

    Agree it is superficial. However it should be corrected. Other superficial errors can be harmful if a beginner developer just copy and paste the code like I did.


    I agree that this is a valid concern because so-called "superficial" errors are often the most problematic, so I'm grateful that you pointed them out to us.


    QUOTE
    Post #23
    I confirmed that Canvas View won't allow you to define key and secret this way
    define(CONSUMER_KEY,"xxx");
    define(CONSUMER_SECRET,"xxx");
    This define statement will cause errors.


    I'm not sure why the define method is causing errors. I've used it in the mysocial.php script and other Y!OS scripts using the SDK without a problem. Perhaps you can show me the errors that you are getting.

    QUOTE
    Even I use a safer way to define the key and secret, I am still getting the same error reported on Post#23
    $consumerKey = "xxx"
    $consumerKeySecret = "xxx"


    Again, I'm not sure what the error could be. I would verify that the keys and secret given in the Application Editor match those in your script. Also, check the scopes that you set for the different APIs in the Application Editor.

    QUOTE
    Note: I do have Contacts, Connections, and Status Message in my Yahoo Profile. I was able to pull the data array via PHP SDK and YQL. In short your mysocial.php sample code is not working. After rendering the $user_profile & $user_updates, it failed on parsing the arrays $user_contacts and the rest.


    I've run the mysocial.php code without a problem. Be sure to set your scopes for the Social Directory APIs in the Application Editor, make sure that your keys are correct, and check for strange characters that might have been copied and then pasted into your script.

    See Set Scopes (Permissions) for Application.

    QUOTE
    Post #27
    If getContactbyGuid is no longer a method in the SDK, can you check if the sample code here is correct and valid?
    $user_contacts = $yahoo_user->getContacts();
    foreach($user_contacts as $contact)....
    I couldn't parse any contact in this array


    I had problems with Contacts in the past because the default scopes do not give you permission to read the Contact API. To correct the problem, I just logged onto My Projects and changed the scopes for the Contact API from the Application Editor.
    QUOTE
    Post #29
    See my fixes on Post #31. You are welcome to use my code in your sample code. You need to limit on the data within the buffer.


    Thanks for your offer, but several developers and myself have used the mysocial.php sample code without any problems. Also, there are developers currently working on creating more sample code for Y!OS.

    Try running the mysocial.php script at the following URL: http://joecatera.net/mysocial.php
    To see the code behind the app (same as mysocial.php in PHP SDK documentation) go to the following URL: http://joecatera.net/mysocial.txt

    The mysocial.php script works for me, but if you encounter problems running this application from the URL above, please let me know. Perhaps there is a bug or an issue with your contacts.

    Thanks again.
    0
  • http://developer.yahoo.com/social/php_guid...-using_yql.html

    Errors?
    1) Error occurred even I used the correct syntax, correct key and secret? I have defined the key and secret. However Canvas View is displaying data from Array $profile, $contacts, $connections, $updates.
    Notice: Use of undefined constant CONSUMER_KEY - assumed 'CONSUMER_KEY' in /var/www/html/yahoo/mysocial_yql.php on line 6
    Notice: Use of undefined constant CONSUMER_SECRET - assumed 'CONSUMER_SECRET' in /var/www/html/yahoo/mysocial_yql.php on line 7

    CODE
    // Include client library.
    require_once("lib/Yahoo.inc");

    // Open Application
    define(CONSUMER_KEY,"xxx");
    define(CONSUMER_SECRET,"xxx");

    // Make sure CONSUMER_KEY et are defined
    $session=YahooSession::requireSession(CONSUMER_KEY,CONSUMER_SECRET);


    2) Canvas View is missing Array $status, $flickr
    Canvas showed Array $profile, $contacts, $connections, $updates. Possible failure on Yahoo server?

    CODE
    // Define YQL queries for the Social Directory APIs
    $profile = "select * from social.profile where guid=me";
    $contacts = "select fields.value from social.contacts where guid=me";
    $connections = "select * from social.connections where guid=me";
    $updates = "select * from social.updates where guid=me";
    $status = "select value.status from social.presence where guid=me";
    $flickr = "select * from flickr.photos.search where text='Cat' limit 10";

    $api_queries = array("Profiles"=>$profile,"Contacts"=>$contacts,"Connections"=>$connections,
    "Updates"=>$updates,"Presence"=>$status,"Flickr"=>$flickr);
    0
  • Fix error no.2
    by limiting each array to 3 data records
    Note: There is a limit on how much data you can render within Canvas View. If you exceed the buffer, it won't show the arrays.

    CODE
    // Define YQL queries for the Social Directory APIs
    $profile = "select * from social.profile where guid=me limit 3";
    $contacts = "select fields.value from social.contacts where guid=me limit 3";
    $connections = "select * from social.connections where guid=me limit 3";
    $updates = "select * from social.updates where guid=me limit 3";
    $status = "select value.status from social.presence where guid=me limit 3";
    $flickr = "select * from flickr.photos.search where text='Cat' limit 3";

    $api_queries = array("Profiles"=>$profile,"Contacts"=>$contacts,"Connections"=>$connections,"Updates"=>$updates,"Presence"=>$status,"Flickr"=>$flickr);


    QUOTE (vivaty.menlopark @ Dec 1 2008, 08:08 PM) <{POST_SNAPBACK}>
    http://developer.yahoo.com/social/php_guid...-using_yql.html

    Errors?
    1) Error occurred even I used the correct syntax, correct key and secret? I have defined the key and secret. However Canvas View is displaying data from Array $profile, $contacts, $connections, $updates.
    Notice: Use of undefined constant CONSUMER_KEY - assumed 'CONSUMER_KEY' in /var/www/html/yahoo/mysocial_yql.php on line 6
    Notice: Use of undefined constant CONSUMER_SECRET - assumed 'CONSUMER_SECRET' in /var/www/html/yahoo/mysocial_yql.php on line 7

    CODE
    // Include client library.
    require_once("lib/Yahoo.inc");

    // Open Application
    define(CONSUMER_KEY,"xxx");
    define(CONSUMER_SECRET,"xxx");

    // Make sure CONSUMER_KEY et are defined
    $session=YahooSession::requireSession(CONSUMER_KEY,CONSUMER_SECRET);


    2) Canvas View is missing Array $status, $flickr
    Canvas showed Array $profile, $contacts, $connections, $updates. Possible failure on Yahoo server?

    CODE
    // Define YQL queries for the Social Directory APIs
    $profile = "select * from social.profile where guid=me";
    $contacts = "select fields.value from social.contacts where guid=me";
    $connections = "select * from social.connections where guid=me";
    $updates = "select * from social.updates where guid=me";
    $status = "select value.status from social.presence where guid=me";
    $flickr = "select * from flickr.photos.search where text='Cat' limit 10";

    $api_queries = array("Profiles"=>$profile,"Contacts"=>$contacts,"Connections"=>$connections,
    "Updates"=>$updates,"Presence"=>$status,"Flickr"=>$flickr);
    0
  • I just fixed error no.1

    Your sample code is no good. Canvas View won't allow you to define key and secret this way:
    define(CONSUMER_KEY,"xxx");
    define(CONSUMER_SECRET,"xxx");

    Please be sure you don't use define in your sample codes.

    CODE
    // Your consumer key goes here.
    $consumerKey = "xxx";

    // Your consumer key secret goes here.
    $consumerKeySecret = "xxx";

    // Make sure CONSUMER_KEY et are defined
    //$session=YahooSession::requireSession(CONSUMER_KEY,CONSUMER_SECRET);
    $session=YahooSession::requireSession($consumerKey,$consumerKeySecret);


    QUOTE (vivaty.menlopark @ Dec 2 2008, 11:54 AM) <{POST_SNAPBACK}>
    Fix error no.2
    by limiting each array to 3 data records
    Note: There is a limit on how much data you can render within Canvas View. If you exceed the buffer, it won't show the arrays.

    CODE
    // Define YQL queries for the Social Directory APIs
    $profile = "select * from social.profile where guid=me limit 3";
    $contacts = "select fields.value from social.contacts where guid=me limit 3";
    $connections = "select * from social.connections where guid=me limit 3";
    $updates = "select * from social.updates where guid=me limit 3";
    $status = "select value.status from social.presence where guid=me limit 3";
    $flickr = "select * from flickr.photos.search where text='Cat' limit 3";

    $api_queries = array("Profiles"=>$profile,"Contacts"=>$contacts,"Connections"=>$connections,"Updates"=>$updates,"Presence"=>$status,"Flickr"=>$flickr);
    0
  • Thanks.

    http://joecatera.net/mysocial.php
    I have tested your mysocial.php. It works.

    I also create a new application with new API and secret and test mysocial.php. It works. EXCEPT I can't use define statement for key and secret as it generates errors. Once I use the safer method for key and secret, then everything work.
    0
  • QUOTE
    I also create a new application with new API and secret and test mysocial.php. It works. EXCEPT I can't use define statement for key and secret as it generates errors. Once I use the safer method for key and secret, then everything work.


    Great, I'm glad it's working for you. As for the define statements, I can't figure out why they wouldn't work because they're used all the time in PHP, and using constants is actually safer than using variables because the values can't be accidentally changed or hacked.

    The only possible reason (that I can imagine) for the define statements not working is if you didn't put quotations or a single quote around both the constant name and the value to assign to the constant.

    Here's an example:
    CODE
    // Quotations are used around the constant name, which is not necessarily seen in other languages.
    define('CONSTANT_NAME', 'value_to_assign_constant');

    // When using the defined constant, do not use the quotation marks around the constant name.
    print(CONSTANT_NAME);


    As for security, using private constants for keys and shared secrets or encryption would be even better.
    0
This forum is locked.

Recent Posts

in Y!OS Documentation