I have an AngularJS app in a VF page which will be interacting with the ChatterAPI. Obviously just making a request with Resource returns a 403 since I am not authenticated.
The only info I can find says that I need to create an app to connect, but I'm not sure if that still applies or will work if my app is on a VF page.
Visualforce
<apex:page showHeader="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false">
<html>
<head>
<script src="angular.js"></script>
<script src="angular-resource.js"></script>
<script src="app.js"></script>
</head>
<body ng-app="Community">
<div ng-controller="CommunityCtrl"></div>
</body>
</html>
</apex:page>
JS
angular.module('Community', ['ngResource']).controller('CommunityCtrl', function($scope, $resource) {
$scope.community = $resource('/services/data/v35.0/connect/communities/COMMUNITY_ID/:action',
{action:'chatter/feeds/news/me/feed-elements'},
{get:{method:'JSONP'}}
);
$scope.community.get();
});
$resource
you may need to setAuthorization headers
?headers: { "Authorization": "Token token='" + SESSION_ID + "'" }
but still not having any luck