54129

Can I get Open Graph page with feed from the API

Question:

What I am trying to do is programmatically create a yammer page based on other website URL (Open Graph Page) and feed information to that OG page. Which I have found out how to do. But now I want to retrieve the OG page feed programatically, is that possible? e.g.

GET https://api.yammer.com/api/v1/activity/OG_URL

which would return the OG Page with messages...

Answer1:

I've also run into quite the same problem, related to fetching open graph objects created on an external Yammer network. To successfully perform the two calls as described by Raggi, use the specific token that is valid for the external network. You can get this token by performing this call (<a href="https://developer.yammer.com/docs/impersonation" rel="nofollow">source</a>) while logged in as a Verified Admin / using a token from a Verified Admin Yammer app: <a href="https://www.yammer.com/api/v1/oauth/tokens.json" rel="nofollow">https://www.yammer.com/api/v1/oauth/tokens.json</a>

From the list of tokens, select the token that matches the external network you use. When performing calls using this specific token (such as <a href="https://www.yammer.com/api/v1/messages.json" rel="nofollow">https://www.yammer.com/api/v1/messages.json</a> or <a href="https://api.yammer.com/api/v1/open_graph_objects.json" rel="nofollow">https://api.yammer.com/api/v1/open_graph_objects.json</a>), they will be targeted at the external network rather than the default (internal) Yammer network.

I ran into this problem when I did the following: As a verified admin, I created a Yammer app on the external network. I used the token generated by the app (<a href="https://developer.yammer.com/docs/test-token" rel="nofollow">source</a>) to create open graph objects on Yammer (wich also creates a post). When I tried to fetch data, such as number of likes, I kept getting 404. To me, it was as if the call tried to fetch data only from the default (internal) network, and was leaving out results from the external network.

Answer2:

Ok, here's the solution that works for me.

<strong>First, get the OG page</strong>

yam.platform.request({ url: "https://api.yammer.com/api/v1/open_graph_objects.json", method: "GET", data: { "url": "http://google.com/robots.txt" //Your OG URL }, [...]

<strong>Then get the OG feed</strong>

yam.platform.request({ url: "https://api.yammer.com/api/v1/messages/open_graph_objects/" + YOUR_OG_ID + ".json", method: "GET", data: {}, [...]

<em>Thanks to Guillaume Carlander for the tips</em>

Recommend

  • oAuth and Yammer
  • JavaScript Show/Hide divs
  • Rely on Facebook user id as a permanent user identifier
  • Netezza Incremental load from Sql server using SSIS
  • LNK1104: cannot open file 'kernel32.lib'
  • How to load Q library with Require.js?
  • How to add learning rate to summaries?
  • Double dispatch in Java example
  • opencv display image without x server
  • How do I shift the decimal place in Python?
  • Application level floating views with navigation in Android
  • Private IP address in reserved subnet range
  • Row to Column conversion in Talend
  • jQuery Orbit - How to make a Random Slideshow?
  • Not able to aggregate on nested fields in elasticsearch
  • How can I enlarge video fullscreen without the affected interface project in as3?
  • Date Conversion from yyyy-mm-dd to dd-mm-yyyy
  • Debug.DrawLine not showing in the GameView
  • Bad request using file_get_contents for PUT request in PHP
  • How to delay loading a property with linq to sql external mapping?
  • CSS Linear-gradient formatting issue accross different browsers
  • How to redirect a user to a different server and include HTTP basic authentication credentials?
  • Incrementing object id automatically JS constructor (static method and variable)
  • script to move all files from one location to another location
  • Can I make an Android app that runs a web view in Chrome 39?
  • How to model a transition system with SPIN
  • Timeout for blocking function call, i.e., how to stop waiting for user input after X seconds?
  • ORA-29908: missing primary invocation for ancillary operator
  • Hibernate gives error error as “Access to DialectResolutionInfo cannot be null when 'hibernate.
  • Error creating VM instance in Google Compute Engine
  • Free memory of cv::Mat loaded using FileStorage API
  • how does django model after text[] in postgresql [duplicate]
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Cant find why the layout is getting smaller
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • LevelDB C iterator
  • Linking SubReports Without LinkChild/LinkMaster
  • unknown Exception android
  • Converting MP3 duration time
  • Python/Django TangoWithDjango Models and Databases