I'm currently putting together a bit of a social hub section and having a few issues grabbing the data from their respective providers.
Twitter is fine, I've managed to get the data through the REST Resource and REST Resource OAuth Session assets and now want to do a similar thing for Facebook and YouTube. Both services seem to use slightly different strains of OAuth and I need to pass in values for the OAuth authentication - 'Request Token Request URL' , 'Authorization Request URL' and 'Access Token Request URL' but I'm not totally sure what these would be for the Facebook Graph API or the YouTube Data API, I've tried a few combinations but have had no luck.
Unlike when I preview the Twitter REST Resource OAuth Session, I get no redirect, just a completely blank page. Has anyone had any experience in setting either of these APIs up within Matrix, if so any assistance would be hugely appreciated.
Further to my initial post. I just thought I'd drop in that I've managed to authenticate a YouTube request via an 'OAuth2 Token' asset as they seem to be a bit more flexible in their feedback but these expire every hour so probably aren't that practical.
Did you use Oauth 1.1? and which version of Matrix are you using the authenticate to Twitter?
I tried to authenticate the Twitter application with Matrix Rest OAuth Session asset but failed to generate the access token as described in the manual.
Then created a REST Resource OAuth Session asset. Chuck in your consumer key, and consumer secret, switch method to GET, enter the 3 URLs which are provided in the Twitter App interface but for reference are: https://api.twitter.com/oauth/request_token, https://api.twitter.com/oauth/authorize and https://api.twitter.com/oauth/access_token, set the callback URL to what you had in the Twitter App, in my case: http://www.herts.ac.uk/_designs/oauth/twitter-rest-oauth-app, ensure the signature method is HMAC-SHA1. At this point, you will see the OAuth details are set to none, however, if you preview your REST Resource OAuth Session you should start to get redirected to Twitter. Once this process is completed refresh your details screen of the OAuth Session and you should have the authentication. Switch 'Store Access Token' to 'Yes'.
Lastly I just created a new REST Resource Javascript and entered my API URL in the URLs section and set the 'Authentication Type' to 'OAuth', click commit and when the screen reloads go back to 'Authentication Type' and use the asset picker to include your OAuth Session. Hit 'Run Test' and see what your results you get.
I've included a couple of screenshots (minus my consumer secret ;) ) for reference.
I did eventually work it out for both of them and did it via OAuth2 Token for both.
For Facebook I just ran the app key on the server as part of the query in the URL.
YouTube was different again in that the OAuth token expired every hour so had to provide an offline_access query string parameter which created the refresh token in Matrix.
I did eventually work it out for both of them and did it via OAuth2 Token for both.
For Facebook I just ran the app key on the server as part of the query in the URL.
YouTube was different again in that the OAuth token expired every hour so had to provide an offline_access query string parameter which created the refresh token in Matrix.
Now all three of them seem to work okay.
Thanks for that!
Ellis
Hi Ellis,
I am trying to do the same thing. Pull in feeds from Facebook, Twiitter and any other social networks we can. To begin with, I am looking at Facebook.
I have already written a custom PHP application that can do this, it generates some JSON data for use with an asset listing. Works fine.
For ease of mainteance, I would prefer to be able to move this into Matrix. We have a number of Facebook accounts and I want to authenticate each of them, have you got an suggestions for this? I can't quite figure out how it translates to the wonderful world of Matrix. For example:
- How do I request different permissions that my app wants from the user who logs in
- Where does the token get stored that facebook returns?