Is it possible to post to Yammer using the praise post format, and can you add a post as another user?
Hi @PowerAppUser875,
You could use the Yammer REST API for posting a praise. I am not sure if the post as another user is possible though.
Below is an example code snippet for posting a praise.
This requires a HTTP connector action, which is a premium connector. You might need an additional license to be able to set this up.
1. Register an app in Yammer. Make sure you obtain the access token and use something like below in the body.
{
"body": "(See+attached+praise)",
"body_format": "PLAIN_TEXT",
"message_type": "praise",
"publisher_type": "yam.ui.publisher.global.PraisePublisher",
"publisher_Source": "group",
"feed_id": "@{variables('YammerDestinationGroup')}",
"feed_view": "default",
"feed_type": "group",
"number_of_recipients": "1",
"invited_user_ids": "",
"group_id": "@{variables('YammerDestinationGroup')}",
"sender_id": "@{variables('SenderUserId')}",
"skip_body_notifications": true,
"praise": "{\"comment\":\"Amazing job again\",\"icon\":\"thumbsup\",\"praised_user_ids\":[@{variables('PraisedUserId')}]}"
}
2. In a test group this will look like this
How did you retrieve the PraisedUserId and is it possible to have it dynamically set. Eg. it's entered in a People picker field in SP list and whichever user is entered gets praised.
Hi @AshMSport,
Yes, that should be possible. Use the e-mail property of that field in a GET user by email request of the Yammer REST API.
Below is an example of that.
Uri field which uses a person or group type column with the name Employee.
https://www.yammer.com/api/v1/users/by_email.json?email=@{triggerOutputs()?['body/Employee/Email']}
The id of the first result.
body('HTTP_-_Get_users_by_email')[0]['id']
I was able to get it to work. Only caveat is the sender username/ID doesn't show up anywhere. Anyway to show it?
User | Count |
---|---|
89 | |
41 | |
22 | |
20 | |
16 |
User | Count |
---|---|
138 | |
56 | |
47 | |
36 | |
26 |