Discussion Board

Results 1 to 5 of 5

Hybrid View

  1. #1
    Hi,
    I am trying to access my gmail contact list through Google Contact API by JavaScript.
    But i am not able to get the authentication for my application.
    Getting error
    The next parameter was missing or bad.
    Any suggestion would be appreciated.
    Thanks in Advance.

  2. #2
    Regular Contributor lorion84's Avatar
    Join Date
    Jun 2010
    Posts
    108
    Give us some code to work with or nobody will be able to help you.

  3. #3
    Here is my Code
    <script type="text/javascript" language="javascript">
    google.load("gdata", "1.x");
    google.setOnLoadCallback(initFunc);
    var contactsService;

    function setupContactsService() {
    contactsService = new google.gdata.contacts.ContactsService('GoogleInc-jsguide-1.0');
    }

    function logMeIn() {
    var scope = 'https://www.google.com/m8/feeds';
    var token = google.accounts.user.login(scope);
    }

    function logMeOut() {

    var scope = 'https://www.google.com/m8/feeds';
    if (google.accounts.user.checkLogin(scope)) {
    google.accounts.user.logout();
    }
    }


    function initFunc() {
    setupContactsService();
    logMeIn();
    getMyContacts();
    logMeOut();
    }

    function getMyContacts() {
    var contactsFeedUri = 'https://www.google.com/m8/feeds/contacts/ziaur18@gmail.com/full';
    var query = new google.gdata.contacts.ContactQuery(contactsFeedUri);

    // Set the maximum of the result set to be 5
    query.setMaxResults(500);

    contactsService.getContactFeed(query, handleContactsFeed, handleError);
    }

    var handleContactsFeed = function(result) {



    var entries = result.feed.entry;

    var t = "Contacts List <table border = 1 align = center width = 50%>";
    t = t + "<tr><td align = center>Name</td><td>Email Address</td></tr>"; //row1

    for (var i = 0; i < entries.length; i++) {
    var contactEntry = entries[i];
    var emailAddresses = contactEntry.getEmailAddresses();
    var name=contactEntry.getTitle().getText();

    for (var j = 0; j < emailAddresses.length; j++) {
    var emailAddress = emailAddresses[j].getAddress();
    t = t + "<tr><td align = center>"+name+"</td><td>"+emailAddress+"</td></tr>";
    }
    }

    t = t + "<table>";

    document.getElementById("showhide").innerHTML = t;
    }

    function handleError(e) {
    alert("There was an error!");
    alert(e.cause ? e.cause.statusText : e.message);
    }


    </script>

  4. #4
    Nokia Developer Moderator isalento's Avatar
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    831
    Hi,

    I briefly checked Contacts API documentation and it states that OAuth 2.0, is used for authentication.
    Unfortunately OAuth 2.0 is not supported in series 40 web apps and for OAuth 1.0 you would have to use a proxy to handle authentication flow.
    http://www.developer.nokia.com/Commu...es_40_Web_Apps

    Br,
    Ilkka

  5. #5
    Hi Ilkka,
    Thanks for you help.

Similar Threads

  1. Replies: 5
    Last Post: 2009-06-23, 12:43
  2. Replies: 3
    Last Post: 2008-12-10, 08:54
  3. Replies: 10
    Last Post: 2008-06-05, 13:36
  4. Replies: 5
    Last Post: 2006-10-12, 13:38
  5. Replies: 3
    Last Post: 2006-10-09, 12:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved