Backend (Everlive) login and query problems

4 posts, 0 answers
  1. AlexFStop
    AlexFStop avatar
    7 posts
    Member since:
    Jan 2014

    Posted 18 Feb 2014 Link to this post

    I'm a first time Telerik App Builder and Everlive user. I created an Everlive Content Type and defined some fields and created 7 records. Next I tried to login and query but I got an error both times. The code is below (with the API key, login and password changed). I based it on my understanding of some of the examples in the documentation.
    For the login attempt I got a "Invalid API key - code 607". For the query I got a "Not found - code 600".
    I have a feeling that I am just not connecting to the Content Type (named "JOAD_ImagesDB") properly (although the debugger shows the return value as non-NULL), so the login failed (though I used the name and password of the only user defined for JOAD_ImagesDB) and then no data was retrieved by the query.
    Obviously I am doing something wrong, but after hours of struggling I can't figure out what. Can anyone suggest something?
    BTW, I am not using Kendo because the app is a very simple one and I don't need the Kendo capabilities.
    Thanks in advance for any help anyone may offer.
    --Alex

    var el = new Everlive({
            apiKey: '123456', 
            url: '//api.everlive.com/v1',
            scheme: 'http'
    }); 
    Everlive.$.Users.login('abc', // username
          'def') // password
        .then(function (data) { // success callback, this returns the token that we can store to avoid re-authenticating this user!
            alert(JSON.stringify(data));
        },
        function(error) { // error callback
            alert(JSON.stringify(error));
        });

    var JOAD_data = el.data("JOAD_ImagesDB");
    var query = new Everlive.Query();
    query.where().lt("Image_Date",LastDate).done().select("Image","Image_Description","Copyright_Owner").take(7);    
    JOAD_data.get(query) // filter
        .then(function(data){
            alert(JSON.stringify(data));
        },
        function(error){
            alert(JSON.stringify(error));
        });


  2. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 18 Feb 2014 Link to this post

    Hello Alex,

    Thank you for contacting us!

    Could you please try with the following initialization of the 'Everlive' object:
    var el = new Everlive({
        apiKey: 'api-key',
        url: '//api.everlive.com/v1/',
        scheme: 'https'
    });

    Please note, the forward slash at the end of the url (this parameter could not be set explicitly).
    Also, you can set the scheme to 'https'.

    Please, let us know if this works for you.

    Regards,
    Anton Dobrev
    Telerik
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
  3. AlexFStop
    AlexFStop avatar
    7 posts
    Member since:
    Jan 2014

    Posted 18 Feb 2014 in reply to Anton Dobrev Link to this post

    Worked like a charm. Thanks a million.
  4. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 19 Feb 2014 Link to this post

    Hello Alex,

    We are glad that this solved the issue.

    In general, it would be better to omit the 'url' parameter when initializing the 'Everlive' object, as it is already set by default in the SDK.

    Regards,
    Anton Dobrev
    Telerik
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
Back to Top