0

YAP sample: can't find my application id

Hi, gang. Trying out the YAP sample app and hitting the wall really quickly. Getting errors like this:

Fatal error: Call to a member function getSessionedUser() on a non-object

I'm guessing I don't have it configured properly. I have three blanks to fill in:

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

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

// Your application ID goes here.
$applicationId = "";

I've found the consumer key in the Permissions tab of the devtool.
I am guessing that consumerKeySecret wants my Shared Secret, but it'd be nice if the variable name was $sharedSecret, to match what's in the devtool.
Where is my application ID, please? Is it that eight-character string after /devtool/ in the editor?

Extra-stupidly yours,

--Kent

6 Replies
  • Hey Kent,

    I think if you make an OAuth app then all these things are up front and correctly named.

    Lemme know if that makes sense,

    Tom
    0
  • QUOTE
    I've found the consumer key in the Permissions tab of the devtool.
    I am guessing that consumerKeySecret wants my Shared Secret, but it'd be nice if the variable name was $sharedSecret, to match what's in the devtool.
    Where is my application ID, please? Is it that eight-character string after /devtool/ in the editor?


    Thanks, Kent, for writing. The variable name $consumerKeySecret should be $sharedSecret. I will make the change to the code now, so the new variable name will be used soon.

    As for the application ID, you are correct: the eight-character string after /devtool/ in the editor is your application ID. The user interface for the Application Editor is undergoing changes at the moment. The new design will list the application ID more clearly. I apologize for the inconvenience.
    0
  • Okay, thanks. Will try again....

    --Kent
    0
  • Right, so I deleted all four inadvertently-created test apps, started a new one, and went all the way through the process of declaring things like its category and title, and all seems to be good now.

    Next question: why won't it let me use the <title> tag? This:

    CODE
    <?php
    require("Yahoo.inc");
    $consumerKey = "[mine]";
    $consumerKeySecret = "[mine]";
    $applicationId = "[mine]";
    $session = YahooSession::requireSession($consumerKey, $consumerKeySecret, $applicationId);
    $user = $session->getSessionedUser();
    $profile = $user->loadProfile();
    header("Content-Type: text/html; charset=utf-8");
    ?>
    <html>
    <head>
    <title>YOS Social Platform Sample Application</title>
    </head>
    <body>
    <?php echo "Welcome, " . $profile->givenName . " " . $profile->familyName; ?>
    </body>
    </html>


    ... yields the following:

    Welcome, Kent Brewster
    Debug Messages:

    stdin:3: <title>YOS Social Platform Sample Application</title>
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    WARNING: stdin:3+9 - 62: tag title is not allowed

    It's fine when I remove the title tag ... but the sample app (as originally shipped) works fine with title intact. What's up?

    --Kent
    0
  • QUOTE
    stdin:3: <title>YOS Social Platform Sample Application</title>
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    WARNING: stdin:3+9 - 62: tag title is not allowed

    It's fine when I remove the title tag ... but the sample app (as originally shipped) works fine with title intact. What's up?

    --Kent


    Hi Kent,

    The title tag works for OAuth Applications, but is blocked for Open Applications. Again, thanks for pointing this out because the tags that are blocked for Open Applications have not been documented. Logically speaking, the title tag for Open Applications should be blocked for Open Applications because these applications will be appearing on Yahoo! pages, where the title will be defined by Yahoo!. Any HTML tag that is not allowed for Open Applications needs to be documented, so thanks again. I'll be sure to post these 'illegal' tags on this thread shortly.

    Thanks again.
    0
  • QUOTE (blisterHead @ Jan 7 2009, 09:52 AM) <{POST_SNAPBACK}>
    I'll be sure to post these 'illegal' tags on this thread shortly.


    More importantly, the <title> tag shouldn't be in use in the working sample app, and then mysteriously stop working when I change the title. :)--Kent
    0

Recent Posts

in YAP