I am consuming a Yammer RESTful API with AngularJS. I have been able to get the yammer user.json api to work but need guidance consuming and displaying the yammer messages.json api. If anybody could help with the scope syntax, that would be cool.
Parse json to return messages > body > rich Here is the code:
Controller
function YammerGetUserCtrl($scope, $http ) {
$http.get('https://api.yammer.com/api/v1/messages.json', {headers: {'Authorization': 'Bearer xxxxxxxxxxxxxxx'}}).
success(function(data) {
$scope.users = data;
console.log($scope.users)
});
}
JSON
{
"threaded_extended": {},
"messages": [
{
"id": 654897910,
"sender_id": 1506696042,
"replied_to_id": null,
"created_at": "2016/02/12 20:55:02 +0000",
"network_id": 11319,
"message_type": "update",
"sender_type": "user",
"url": "https://www.yammer.com/api/v1/messages/654897910",
"web_url": "https://www.yammer.com/arrow.com/messages/654897910",
"body": {
"urls": [
"https://www.youtube.com/watch?v=yueP7V6Wddc&index=7&list=PLKsggbHA8DermEtbMcC80M38cuR5rFdgi"
],
"parsed": "Our shiny new aerospace [[tag:8909387]] that ran in Colorado markets during Super Bowl 50 is going viral! In less than one week since broadcast, we have more than 414,000 views on YouTube, increasing by thousands an hour. The [[tag:8898375]] has caught media attention around the world in the UK, Ireland, Australia, Germany and more. Even mention by MIT Media Lab.\n\nhttps://www.youtube.com/watch?v=yueP7V6Wddc&index=7&list=PLKsggbHA8DermEtbMcC80M38cuR5rFdgi",
"plain": "Our shiny new aerospace #ad that ran in Colorado markets during Super Bowl 50 is going viral! In less than one week since broadcast, we have more than 414,000 views on YouTube, increasing by thousands an hour. The #video has caught media attention around the world in the UK, Ireland, Australia, Germany and more. Even mention by MIT Media Lab.\n\nhttps://www.youtube.com/watch?v=yueP7V6Wddc&index=7&list=PLKsggbHA8DermEtbMcC80M38cuR5rFdgi",
"rich": "Our shiny new aerospace <span class='yammer-object' data-yammer-object='tag:8909387' data-resource-id='8909387' data-resource-model='tag'>#<a href='https://www.yammer.com/arrow.com/topics/11782336'>ad</a></span> that ran in Colorado markets during Super Bowl 50 is going viral! In less than one week since broadcast, we have more than 414,000 views on YouTube, increasing by thousands an hour. The <span class='yammer-object' data-yammer-object='tag:8898375' data-resource-id='8898375' data-resource-model='tag'>#<a href='https://www.yammer.com/arrow.com/topics/8400514'>video</a></span> has caught media attention around the world in the UK, Ireland, Australia, Germany and more. Even mention by MIT Media Lab.<br><br><a class=\"linkified\" href=\"https://www.youtube.com/watch?v=yueP7V6Wddc&index=7&list=PLKsggbHA8DermEtbMcC80M38cuR5rFdgi\" title=\"https://www.youtube.com/watch?v=yueP7V6Wddc&index=7&list=PLKsggbHA8DermEtbMcC80M38cuR5rFdgi\" target=\"_blank\"
.....
}
So I would like to display the url and rich excerpt from the body. How can I do it?