How do I show/allow yammer user input on embed topic feed - yammer

I'm attempting to embed a Yammer feed on a webpage to present all posts based on a topic (hashtag).
At the same time, I want the ability for users to create new Yammer posts at the top of the widget.
From all combinations of settings, I cannot find the ability to do both.
Users seemingly can post when "feedType" is [blank] or "all", but not "topic".
Is it possible to both display a Topic feed and allow the user to create a new post?
Settings for Topic feed:
yam.connect.embedFeed({
container: '#yammer-feed',
network: 'company.com',
feedType: 'topic',
feedId: '1308', // #yam hashtag
config: {
defaultGroupId: 'all',
header: true
}
});
Settings enabling Post ability
yam.connect.embedFeed({
container: '#yammer-feed',
network: 'company.com',
feedType: '', // now blank - user post input appears
feedId: '1308', // seemingly worthless w/ this feedType
config: {
defaultGroupId: 'all',
header: true
}
});
Can I have both?

The reason you don't see the ability to add a new post when you have a topic feed is that Yammer doesn't have a way to automatically tag the new post. The posts have to exist in a group (even All Network is a group) and thus just putting a topic wouldn't be enough.
So sorry that there isn't a way to do what you are looking for - have you thought about using OpenGraph to have a comment feed in addition to the topic feed perhaps?

Related

Cant create Microsoft Teams online meetings for some users (Defaults to OnlineMeetingProvider.Unknown) via Graph Api

I have 5 users, they all look the same in Office 365 (from what I can see anyway) and have Teams Exploratory licences. I am able to create online meetings (OnlineMeetingProvider="teamsForBusiness" and IsOnlineMeeting=true) for 2 of them. For the other 3 users it doesn't error but doesn't create an online meeting (creates an event?), the response OnlineMeetingProvider is "unknown" and the OnlineMeeting is null. It is the same code so has to be a setting somewhere (all i do is change the id of the user).
The code used to create the request:
// Create client
var graphServiceClient = CreateGraphClient();
// Build event
var newEvent = new Event()
{
Subject = subject,
Body = new ItemBody() { ContentType = BodyType.Text, Content = body },
Start = startDate,
End = endDate,
IsOnlineMeeting = true,
Attendees = attendees == null ? null : GetAttendees(attendees),
OnlineMeetingProvider = OnlineMeetingProviderType.TeamsForBusiness
};
The erroneous response:
Anyone have any idea what is going on?
Had the same problem, I had to add these permissions to the app I was using to create the meeting events:
TeamSettings.Read.All, TeamSettings.ReadWrite.All
As soon as I added them, isOnlineMeeting was correctly set to true, and onlineMeetingProvider was set to teamsForBusiness, as specified in the request.
onlineMeetingUrl is always null, but it's possible to get the meeting url from the "onlineMeeting.joinUrl" property, which is automatically populated by the API.
UPDATE:
As #lokusking pointed out, even if this is correct, it looks like it does not completely solve the problem. According to my tests, creating a Team event for a new user and getting isOnlineMeeting=true and onlineMeeting properly populated in the response will work only a couple of hours after the user account is created. Note that even with a fresh user the event IS created, just those properties won't contain the right values.
You can change an existing event to make it available as an online meeting, by setting isOnlineMeeting to true, and onlineMeetingProvider to one of the online meeting providers supported by the parent calendar. The response includes the updated event with the corresponding online meeting information specified in the onlineMeeting property.
https://learn.microsoft.com/en-us/graph/outlook-calendar-online-meetings?tabs=http#example-update-a-meeting-to-make-it-available-as-an-online-meeting

Google People API / Other Contacts - how to get photos of other contacts?

Google forces us to migrate from the deprecated Contacts API over new People API.
They even implemented "Other Contacts" feature in the People API which was so demanded.
But now I'm facing another problem - there is no way to get photos of Other Contacts in the People API.
I was digging into this problem and figured out that it's possible to add photos into the readMask (even though it's not documented):
https://people.googleapis.com/v1/otherContacts?access_token=<...>&readMask=emailAddresses,names,photos
...but it doesn't help, because it returns the default picture with the first letter for all contacts, even for contacts who has a real photo. Like this one: https://lh3.googleusercontent.com/cm/ABXenNkcRSTRZU8PEFQfJtaeEBZnxLgN-UO555npUt1idzcMohoSGuJFfKx0JX2AR6Qp=s100
I tried to add coverPhotos into the readMask but it doesn't let it there.
Then I was checking how old Contacts API formats photo urls and figured out the format:
https://www.google.com/m8/feeds/photos/media/<user-email-address>/<contact-id>
But it has 2 disadvantages:
this url has to be requested with access_token
it works only if the contact uploaded a custom photo, otherwise it returns error
So here is my question:
Is there any simpler and cleaner way to get real photos of Other Contacts in People API?
This bug has been solved and now we have a solution!
Updated documentation: https://developers.google.com/people/api/rest/v1/otherContacts/list
There is a new sources[] request parameter. To get the real photos of "other contacts" you need to specify 2 values: READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE.
The request would look like this:
GET https://people.googleapis.com/v1/otherContacts?readMask=photos&key=API_KEY&sources=READ_SOURCE_TYPE_CONTACT&sources=READ_SOURCE_TYPE_PROFILE
Now some contacts will contain 2 entries in the photos array:
photos: [
{
metadata: {
primary: true,
source: {
type: "PROFILE",
id: "11111"
}
},
url: "<THIS IS THE REAL PROFILE PICTURE>"
},
{
metadata: {
source: {
type: "OTHER_CONTACT",
id: "6666666"
}
},
url: "<THIS IS THE DEFAULT PHOTO STUB>",
default: true
}
]
The readMask fields accepted for the otherContacts.list method are the following:
emailAddresses
metadata
names
phoneNumbers
photos
As you can notice, the photos field is an accepted one while making the above request.
However, the returned response should yield a url which redirects you to the user's profile picture. Because of this, I have taken the opportunity to report it on Google's Issue Tracker here. I suggest you star the issue as any updates regarding this will be posted there.
Reference
People API otherContacts.list;
People API Support.

Amplify and AppSync not updating data on mutation from multiple sources

I have been attempting to interact with AppSync/GraphQL from:
Lambda - Create (works) Update (does not change data)
Angular - Create/Update subscription received, but object is null
Angular - Spoof update (does not change data)
AppSync Console - Spoof update (does not change data)
Post:
mutation MyMutation {
updateAsset(input: {
id: "b34d3aa3-fbc4-48b5-acba-xxxxxxxxxxx",
owner: "51b691a5-d088-4ac0-9f46-xxxxxxxxxxxx",
description: "AppSync"
}) {
id
owner
description
}
}
Response:
{
"data": {
"updateAsset": {
"id": "b34d3aa3-fbc4-48b5-acba-xxxxxxxxxx",
"owner": "51b691a5-d088-4ac0-9f46-xxxxxxxxxxx",
"description": "Edit Edit from AppSync"
}
}
The version in DynamoDB gets auto-incremented each time I send the query. But the description remains the same as originally set.
Auth Rules on Schema -
#auth(
rules: [
{ allow: public, provider: apiKey, operations: [create, update, read] },
{ allow: private, provider: userPools, operations: [read, create, update, delete] }
{ allow: groups, groups: ["admin"], operations: [read, create, update, delete] }
])
For now on the Frontend I'm cheating and just requesting the data after I received a null subscription event. But as I've stated I only seem to be able to set any of the data once and then I can't update it.
Any insight appreciated.
Update: I even decided to try a DeleteAsset statement and it won't delete but revs the version.
I guess maybe the next sane thing to do is to either stand up a new environment or attempt to stand this up in a fresh account.
Update: I have a working theory this has something to do with Conflict detection / rejection. When I try to delete via AppSync direct I get a rejection. From Angular I just get the record back with no delete.
After adding additional Auth on the API, I remember it asked about conflict resolution and I chose "AutoMerge". Doc on this at https://docs.aws.amazon.com/appsync/latest/devguide/conflict-detection-and-sync.html
After further review I'll note what happened in the hopes it helps someone else.
Created amplify add api
This walked me thru a wizard. I used the existing Cognito UserPool since I had not foreseen I would need to call this API from a S3 Trigger (Lambda Function) later.
Now needing to grant apiKey or preferably IAM access from the Lambda to AppSync/GraphQL API I performed amplify update api and added the additional Auth setting.
This asked me how I wanted to solve conflict, since more than one source can edit the data. Because I just hit "agree" on Terms and Conditions and rarely read the manual; I selected 'AutoMerge' .. sounds nice right?
So now if you read the fine print, edits made to a table will be rejected as we now have this _version (Int) that would need to get passed so AutoMerge can decide if it wants to take your change.
It also creates an extra DataStore Table in DynamoDB tracking versions. So in order to properly deal with this strategy you'd need to extend your schema to include _version not just id or whatever primary key you opted to use.
Also note: if you delete it sets _delete Bool to true. This actually still is returned to the UI so now your initial query needs to filter off (or not) deleted records.
Determined I also didn't need this. I don't want to use a Datastore (least not now) so: I found the offender in transform.conf.json within the API. After executing amplify update api, GraphQL, I chose 'Disable Datastore for entire API` and it got rid of the ConflictHandler an ConflictDetection.
This was also agitating my Angular 11 subscription to Create/Update as the added values this created broke the expected model. Not to mention the even back due to nothing changing was null.
Great information here, Mark. Thanks for the write up and updates.
I was playing around with this and with the Auto Merge conflict resolution strategy I was able to post an update using a GraphQL mutation by sending the current _version member along.
This function:
await API.graphql(
graphqlOperation(updateAsset, {
input: {
id: assetToUpdate.id,
name: "Updated name",
_version: assetToUpdate._version
}
}
));
Properly updates, contacts AppSync, and propagates the changes to DynamoDB/DataStore. Using the current version tells AppSync that we are up-to-date and able to edit the content. Then AppSync manages/increments the _version/_createdAt/etc.
Adding _version to my mutation worked very well.
API.graphql({
query: yourQuery,
variables: {
input: {
id: 'your-id',
...
_version: version,
},
},
});

Change label in Google contacts

I want to synchronize contacts in my application with Google contacts. But not all of them, just those with the right label (tag). I'm using Google's People Apis for this. But I ran into a problem, the memberships property/field which holds informations about labels is read only. I can't even create a contact/person with the right label. It throws an error. Is there a way how to update or create a contact with label?
For mor information head here.
EDIT:
I've tried both creating and updating a contact. Sending a POST and PATCH request message on https://people.googleapis.com/v1/people:createContact (similiar to update contact). Both fail with the same error, memberships parameter is read-only.
contactGroupId is the id of the label I'm trying to assaign to the contact.
Request body:
{
"memberships": [
{
"contactGroupMembership": {
"contactGroupId": "45asd3d7321gd"
}
}
]
... //Other parameters
}
You should use contactGroups.members.modify api call

How do I hide posts with a specific hashtag in Yammer?

I want to hide posts in the feed that have a #joined hashtag. I tried to create a GreaseMonkey script with jQuery in the past, but it couldn't detect any posts that have the #joined text.
Am I using the wrong library? A starting point, or an existing library/plug-in would be helpful.
OFF-TOPIC: At the moment, Yammer does not have any feature to hide posts with a specific hashtag, although it has a feature to follow a hashtag.
I know that this is a pretty old question but I too was trying to create a Chrome based Add-on that hides these #joined posts (or any post with a specific hashtag). I came across this blog https://you.stonybrook.edu/thebaron/2014/10/06/hiding-joined-yammer-posts-in-chrome/ where the author of the post has shared his work (https://gist.github.com/thicknrich/e4cc2871462a6850fe8c). This is a simple javascript and does the job.
//Script from https://gist.github.com/thicknrich/e4cc2871462a6850fe8c
//load jQuery based on this SO Post:
//http://stackoverflow.com/questions/2246901/how-can-i-use-jquery-in-greasemonkey-scripts-in-google-chrome
// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}
// the guts of this userscript
function main() {
// Note, jQ replaces $ to avoid conflicts.
setInterval(function() {
//if a item thread contains #joined, hide it
//check every 5 second.
jQ('.yj-thread-list-item:contains("#joined")').css("display", "none");
}, 5000);
}
// load jQuery and execute the main function
addJQuery(main);
You can find all joined messages with the following endpoint, based upon the #joined topic:
GET https://www.yammer.com/api/v1/messages/about_topic/[:id].json
But you can only delete messsages that you own:
DELETE https://www.yammer.com/api/v1/messages/[:id]
Source: https://developer.yammer.com/restapi/
Note that this is a conscious decision by the product team, although joined messages can get spammy when a network becomes viral, it is a great opportunity to engage users right away once they join. It makes them feel welcome. As a community manager, I'd encourage you to welcome that user in and also encourage other yammer champions to welcome these users also. As a side effect, it also encourages people to follow the groups they are interested in and use the Top or Following feeds instead of the all (firehose) feed which has all these joined messages.
Just want to note that the statement in a reply here "But you can only delete messsages that you own" is not entirely correct it is possible to delete message that do not belong to you if you are a network admin. I just ran a little experiment after reading this post and deleting #joined messages that don't belong to me worked just fine.

Resources