Apigee 17/21


#1

function viewMyFeed(){
var client = new Usergrid.Client({
//Intialize your client with the proper credentials
orgName:"USERNAME",
appName:"sandbox"
});

//Replace "USERNAME" with the user you want to get a feed for!
client.getFeedForUser("USERNAME", function(error, data, activities){
    for(var i = 0; i < activities.length; i++) {
        var activity = activities[i];
        //Use the .content property on the object to get the content data!
        var content = activity.content;
        $("#response").append("<li>"+content+"</li>");
    }
});

}

Can anyone please help me what's wrong with this chapter? I'm really stuck! I've been stuck for weeks.


#2

Be sure to pay close attention to sections of the code that are commented out. Where is says "orgName", add the username you chose when you signed up for apigee. Also, add your username to the getFeed function. Let me know if that works!


#3

I have found that the user created on apigee and the one i created "additional" seems to cause havoc: This was my eventual solution that worked....

function viewMyFeed(){
var client = new Usergrid.Client({
//Intialize your client with the proper credentials
orgName:"cheslynar", /* THIS IS MY USERNAME IN APIGEE */
appName:"sandbox"
});

//Replace "USERNAME" with the user you want to get a feed for!
client.getFeedForUser("rayaana", function(error, data, activities){ /* THIS WAS THE USER CREATED IN ONE OF THE EARLIER EXERCISES */
for(var i = 0; i < activities.length; i++) {
var activity = activities[i];
//Use the .content property on the object to get the content data!
var content = activity.content;
$("#response").append("

  • "+content+"
  • ");
    }
    });
    }