Yammer api : Get messages by group - api

Here are the yammer api docs: http://developer.yammer.com/restapi/
Am I missing something here? How can I get the messages for a specific group? There seems to be a good deal of undocumented functionality.

I agree the documentation appears lacking.
Maybe:
https://www.yammer.com/api/v1/messages/in_group/<<GROUPID>>.json?access_token=<<ACCESSTOKEN>>"
via http://balamurugankailasam.blogspot.com/2012/10/displaying-yammer-feed-private-group-in.html
Embeded feeds support this functionailty:
feedType – Type of Feed to be displayed: group, topic, user, or Open Graph object
feedID – ID of the group, topic, or user feed (not applicable for Open Graph or My Feed)
Example
<script data-app-id="hyB2pTvrL36Y50py8EWj6A" src="https://assets.yammer.com/platform/yam.js"></script>
<script>
yam.connect.embedFeed(
{ container: '#embedded-feed',
network: 'fourleaf.com',
feedType: 'group', // can be 'group', 'topic', or 'user'
feedId: '123' // feed ID from the instructions above
});
</script>
<div id="embedded-feed"></div>
via http://developer.yammer.com/connect/

Related

How can I get and use the properties I need from this GraphQL API using Dart?

Before you start reading: I have looked at the GraphQL documentation, but my usecase is so specific and I only need the data once, and therefore I allow myself to ask the community for help on this one to save some time and frustration (not planning to learn GraphQL in the future)
Intro
I am a CS student developing an app for Flutter on the side, where I need information about the name and location of every bus stop in a specific county in Norway. Luckily, there's an open GraphQL API for this (API URL: https://api.entur.io/stop-places/v1/graphql). The thing is, I don't know how to query a GraphQL API, and I do not want to spend time learning it as I am only going to fetch the data once and be done with it.
Here's the IDE for the API: https://api.entur.io/stop-places/v1/ide
And this is the exact query I want to perform as I want to fetch bus stops located in the county of Trondheim:
{
stopPlace(stopPlaceType: onstreetBus, countyReference: "Trondheim") {
name {
value
}
... on StopPlace {
quays {
geometry {
coordinates
}
}
}
}
}
The problem with this query though, is that I don't get any data when passing "Trondheim" to the countyReference (without countyReference I get the data, but not for Trondheim). I've tried using the official municipal number for the county as well without any luck, and the documentation of the API is rather poor... Maybe this is something I'll have to contact the people responsible for the API to figure out, which shouldn't be a problem.
But now back to the real problem - how can I make this query using the GraphQL package for Dart? Here's the package I'm planning to use: (https://pub.dev/packages/graphql)
I want to create a bus stop object for each bus stop, and I want to put them all in a list. Here is my bus stop model:
class BusStop with ChangeNotifier {
final String id;
final String name;
final LatLng location;
BusStop({
this.id,
this.name,
this.location
});
}
When it comes to authentication, here's what the documentation says:
This API is open under NLOD licence, however, it is required that all consumers identify themselves by using the header ET-Client-Name. Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers. The structure of ET-Client-Name should be: "company - application"
Header examples: "brakar - journeyplanner" "fosen_utvikling - departureboard" "norway_bussekspress - nwy-app"
Link to API documentation: https://developer.entur.org/pages-nsr-nsr
Would be great to know how I should go about this as well! I'm grateful for every answers to this, I know I am being lazy here as of learning GraphQL, but for my usecase I thought it would take less time and frustration by asking here!
Getting the query right
First of all you seem to have GraphQL quite figured out. There isn't really much more to it than what you are doing. What queries an API supports depends on the API. The problem you seem to have is more related to the specific API that you are using. I might have figured the right query out for you and if not I will quickly explain what I did and maybe you can improve the query yourself:
{
stopPlace(stopPlaceType: onstreetBus, municipalityReference: "KVE:TopographicPlace:5001") {
name {
value
}
... on StopPlace {
quays {
geometry {
coordinates
}
}
}
}
}
So to get to this I started finding out more about "Trondheim" bei using the topographicPlace query.
{
topographicPlace(query: "Trondheim") {
id
name {
value
}
topographicPlaceType
parentTopographicPlace {
id
name {
value
}
}
}
}
If you do that you will see that "Trondheim" is not a county according to the API: "topographicPlaceType": "municipality". I have no idea what municipality is but the is a different filter for this type on the query that you provided. Then putting "Trondheim" there didn't yield any results so I tried the ID of Trondheim. This now gives me a bunch of results.
About the GraphQL client that you are using:
This seems to be an "Apollo Client" clone in Dart. Apollo Client is a heavy piece of software that comes with a lot of awesome features when used in a frontend application. You probably just want to make a single GraphQL request from a backend. I would recommend using a simple HTTP client to send a POST request to the GraphQL API and a JSON body (don't forget content type header) with the following properties: query containing the query string from above and variables a JSON object mapping variable names to values (only needed if you decide to add variables to your query.

How to get feeds of facebook using simple facebook?

I am trying to get all the feeds of facebook id. I got all the feeds using graph explorer tools but when I use simple facebook 2.0 in android, I didn't get all feeds but few.
`String entityId = "me";
String edge = "feed";
//Bundle params = new Bundle();
//params.putString("fields", "feed");
simpleFacebook.get(entityId, edge, null, onActionListener);`
Above code is my part of simple facebook code.
I want the result that is similar to the result of me?fields=feed. How can I get the result? I don't want to use facebook SDK 3.15.0.
Your help is highly appreciated.
Use getPosts() method:
String entityId = ...;
mSimpleFacebook.getPosts(entityId, PostType.ALL, onPostsListener);
You can filter by:
PostType.ALL - Everything that was published (links, statuses, photos...) that appears on the users' wall. (uses graph path: *{entityId}/feed)
PostType.LINKS - Link published by the entity. (uses graph path: {entityId}/links)
PostType.POSTS - Posts published by the entity. (uses graph path: {entityId}/posts)
PostType.STATUSES - Status update posts published by the entity. (uses graph path: {entityId}/statuses)
PostType.TAGGED - Posts in which the person is tagged. (uses graph path: {entityId}/tagged)

Yodlee Rest APIs and all possible responses

I am looking for a more detailed list of possible API responses when using Yodlee's REST API. Think of it as an XSD response but for a JSON string. I want to know if there are possible data elements that are not listed Yodlee's JSON response examples.
The only info I can really find so far is here.
When I review these examples, it appears that the example JSON responses do not fully describe every field.
Here is part of the getItemSummaryForItem1 JSON example for maturityDate element
"maturityDate":{
},
It looks like there is an array, but the possible data elements for that maturityDate array are undeclared. Then later on maturityDate is shown to be:
"maturityDate":{
"date":"0014-02-01T00:00:00-0800",
"localFormat":"dd/MM/yyyy"
},
And then in another example from getUserTransactionCategories
{
"categoryId":31,
"categoryName":"Retirement Income",
"transactionCategoryTypeId":2,
"isBudgetable":1,
"localizedCategoryName":"Retirement Income",
"isHidden":false,
"categoryLevelId":3
},
Based on that I would think all possible data elements are there.
But then there is another one which introduces the childCategory data element
{
"categoryId":2,
"categoryName":"Automotive Expenses",
"isDeleted":0,
"transactionCategoryTypeId":4,
"isBudgetable":1,
"localizedCategoryName":"Automotive Expenses",
"isHidden":false,
"categoryLevelId":3,
"childCategory":[
{
"categoryId":5641,
"categoryName":"1_SubCategory1",
"categoryDescription":"Subcategory desc1",
"isDeleted":0,
"isBudgetable":0,
"localizedCategoryName":"1_SubCategory1",
"isHidden":false,
"parentCategoryId":2,
"categoryLevelId":4
}
}
Thanks!
Yodlee team is working on to get this details documented, this is a time taking process and will be soon available over their portal. Meanwhile, is there any specific field or API response for which you are looking to get all the child elements which will help you out without blocking your integration?

Get a list of all artists from Soundcloud

Is there any way of getting a list of all artists who are presented on Soundcloud ( via it`s API or by some other means) ?
Here is a bit of code which should point you in the right direction.
Problem could be the response limit, which is 200.
That's why you have to store the responses anywhere to get a full list of all artists (users) on SC.
To get a list of users you can do the following by using the SC JS SDK.
May be you can play around with the q parameter.
JS Code:
SC.initialize({ client_id: "201b55a1a16e7c0a122d112590b32e4a"});
SC.get('/users', { limit: 200}, function(users) { console.log(users);});
Example here:
http://jsfiddle.net/iambnz/9kUwq/
Docs:
http://developers.soundcloud.com/docs/api/guide#search
http://developers.soundcloud.com/docs/api/reference#users

How do I post a message to Yammer with a specific topic using the API?

I've got an application using the Yammer API, and I have a specific topic that I'd like to apply to a message (I know it by topicid).
The API is incredibly unclear: https://developer.yammer.com/api/#messages-manipulating
>*topicn*
>
>Topics to apply to the message. Can use topic1 through topic20.
If I send a message with
topic1:1234567
Where the number is a topicid. I get a message with a topic entitled the topic number.
Any idea what the syntax is to get the topic to match that topicid instead of creating a new one?
I struggled with the documentation as well - for me, the following worked: "body=A message with topics #foo #bar". In other words, the topics are the actual tags. Note that depending on the media type you set, certain characters (such as ";") may be problematic in the string.
You can both :
add the tag in the message Body.
Exemple if your topic is "Software" and you add in the message Body #Software you will see that the topic Software has been added to your post but you will also see #Software as a link in the message body. Not fantastic...
pass the topic in parameter
This is the correct syntax :
yam.platform.request(
{
url: "https://api.yammer.com/api/v1/messages.json"
, method: "POST"
, data: {
"body" : msg_value
,"group_id" : groupID
,topic1 : "Software"
}
...
Doing it that way, you won't see the topic name in the post...This is much better :-)