0

multiple getauthservice calls

I tried this code sequence in the html click view
var auth = openmail.Application.getAuthService({});
var auth2 = openmail.Application.getAuthService({});
It doesnt seem to hinder the app for running, but I wonder, what if I want to make nested yql calls?
With two different getauthservice's can you use them to make nested callwebservice calls

auth.callWebService({
    url: 'http://query.yahooapis.com/v1/yql',
    method: 'GET',
    parameters: {
format: "json",
q: str1
    },
    function(args) {
auth2.callWebService({
url: 'http://query.yahooapis.com/v1/yql',
method: 'GET',
parameters: {
format: "json",
q: str2
}, function(args2) {
//documentid push in
}
});
}
});

by
2 Replies
  • You could reuse the same auth service, you don't need 2.

    The syntax you're using for getAuthService is for oauth refined for Yahoo! endpoints:
    http://developer.yahoo.com/mailapplications/auth.html#refined

    It won't work for your app unless we enable app-specific permissions for your app on our side.

    W/o those permissions, you'd need to so something more like this:
    getAuthService</span><span class="br0" style="color:#009900;">(</span><span class="br0" style="color:#009900;">{</span> profile <span class="sy0" style="color:#339933;">:</span> <span class="st0" style="color:#3366cc;">&#39;yahoo&#39;</span> <span class="br0" style="color:#009900;">}</span><span class="br0" style="color:#009900;">)</span>

    and have the corresponding profile in your auth.xml.  See the YQL sample for more info:
    http://developer.yahoo.com/mailapplications/samples/yql.html

    -j


    QUOTE(Houyhnhnm @ 10 Oct 2011 9:05 PM)
    I tried this code sequence in the html click view
    var auth = openmail.Application.getAuthService({});
    var auth2 = openmail.Application.getAuthService({});
    It doesnt seem to hinder the app for running, but I wonder, what if I want to make nested yql calls?
    With two different getauthservice's can you use them to make nested callwebservice calls

    auth.callWebService({
        url: 'http://query.yahooapis.com/v1/yql',
        method: 'GET',
        parameters: {
    format: "json",
    q: str1
        },
        function(args) {
    auth2.callWebService({
    url: 'http://query.yahooapis.com/v1/yql',
    method: 'GET',
    parameters: {
    format: "json",
    q: str2
    }, function(args2) {
    //documentid push in
    }
    });
    }
    });
    0
  • alright, i made the changes.Thanks. 

    QUOTE(joecomotion @ 18 Oct 2011 6:09 PM)
    You could reuse the same auth service, you don't need 2.

    The syntax you're using for getAuthService is for oauth refined for Yahoo! endpoints:
    http://developer.yahoo.com/mailapplications/auth.html#refined

    It won't work for your app unless we enable app-specific permissions for your app on our side.

    W/o those permissions, you'd need to so something more like this:
    getAuthService</span><span class="br0" style="color:#009900;">(</span><span class="br0" style="color:#009900;">{</span> profile <span class="sy0" style="color:#339933;">:</span> <span class="st0" style="color:#3366cc;">&#39;yahoo&#39;</span> <span class="br0" style="color:#009900;">}</span><span class="br0" style="color:#009900;">)</span>

    and have the corresponding profile in your auth.xml.  See the YQL sample for more info:
    http://developer.yahoo.com/mailapplications/samples/yql.html

    -j


    QUOTE(Houyhnhnm @ 10 Oct 2011 9:05 PM)
    I tried this code sequence in the html click view
    var auth = openmail.Application.getAuthService({});
    var auth2 = openmail.Application.getAuthService({});
    It doesnt seem to hinder the app for running, but I wonder, what if I want to make nested yql calls?
    With two different getauthservice's can you use them to make nested callwebservice calls

    auth.callWebService({
        url: 'http://query.yahooapis.com/v1/yql',
        method: 'GET',
        parameters: {
    format: "json",
    q: str1
        },
        function(args) {
    auth2.callWebService({
    url: 'http://query.yahooapis.com/v1/yql',
    method: 'GET',
    parameters: {
    format: "json",
    q: str2
    }, function(args2) {
    //documentid push in
    }
    });
    }
    });
    0
This forum is locked.

Recent Posts

in Yahoo! Mail Application Platform