How to embed a video player when posting a message with Yammer API? - yammer

I can't figure it out how to embed a video player when posting a message with Yammer API.
I have been testing the Yammer API with postman:
As response, I got "400 bad request":
{
"body": [
"Please include a message"
],
"code": "body_blank"
}
If I just paste the video url in "body", I will get "201 created". But in Yammer, the post looks like:
I would like the post looks similar to this:
Does anyone know how to do it? Thanks!

I figured it out by myself. Add following parameters in the request body:
Result:

Related

Google API - Google Play Services - Error 500 Message:Null

Request URL:
https://content.googleapis.com/games/v1/players/[CORRECT_PLAYER_ID]?access_token=[CORRECT_APPLICATION_ACCESS_TOKEN]
The application is Server and set up like here:
https://developers.google.com/identity/protocols/OAuth2ServiceAccount
The only response is:
{
"error": {
"code": 500,
"message": null
}
}
In API Explorer I have:
...
"code": 401,
"message": "User has not completed registration."
...
What is wrong with my use case? How I can workaround Verification of Google Play Services User ID?
A 500 response is a server-side error, which sounds more like a bug than a question. It looks like they have a place to report bugs here.
I think this might not execute through the APIs Explorer this way because you haven't registered your project with the credentials being used; it doesn't currently have a way to use your own credentials instead.

Http POST from card in Microsoft Teams

We are trying to create an approval workflow using Teams, Flow, and Assembla and are running into a bit of trouble.
We have a few of the pieces successfully setup however we are unable to initiate a POST action from a card in Teams.
In teams we can successfully create a card using the incoming webhook connector with this result.
This is created with the following JSON body from a POST action in Flow
{
"##type": "MessageCard",
"##context": "http://schema.org/extensions",
"summary": "This is the summary property",
"themeColor": "f46b42",
"sections": [
{
"startGroup": true,
"title": "**Pending Review**",
"activityTitle": "Ticket Title",
"activitySubtitle": "Requested by: ",
"facts": [
{ "name": "Date submitted:", "value": "06/27/2017, 2:44 PM" },
{ "name": "Details:",
"value": "This ticket is ready for review." }
]
},
{
"potentialAction": [
{
"##type": "HttpPOST",
"name": "Approve",
"target": "ANOTHER-POST-URL-IS-HERE"
},
{
"##type": "HttpPOST",
"name": "Deny",
"target": "ANOTHER-POST-URL-IS-HERE"
}
]
}
]
}
We have another Flow url as the target for both buttons on the card. To test this url we are able to successfully post via POSTMAN and continue the approval workflow.
When clicking the button on the Team card the Flow at the post url is in no way notified at all. No run on Flow is triggered. In teams a very generic "There was a problem submitting your changes. Try again in a minute." error is displayed.
After researching I ran across the connectors.md file on the Microsoft Teams github page and noticed this lovely part of the documentation
It seems odd to me that right below them mentioning that POST actions may not be supported the documentation goes on in length to show examples of using POST and ActionCard actions in a card on teams.
So my question is this, is there any way to get an HttpPOST action to work from a custom card in Teams to a Microsoft Flow POST URL?
Thanks!
Update:
Upon further testing we have determined that HttpPOST actions
work with just about any post url we can come up with except
Microsoft Flow Request URLs. They are exceptionally long urls so maybe
that has something to do with it?
Here's an example Flow request url.
https://prod-43.westus.logic.azure.com:443/workflows/f86b928acd3d4ecab849f677974f7816/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=ZBxr5GFKQhMp4JXWGmec_L6aqgcaqvCOKUWOf2li-xQ
When running teams in a web browser we are able to see the request
first posts to a api.teams.skype.com url and returns a generic
"ProviderError". Other non-flow urls also do the same but return
success.
This was a head-scratcher for us - as you surmised, this should have worked. The Teams, Flow, and Outlook teams troubleshooted this today and found out what was going on.
The URL you are posting to, https://prod-43.westus.logic.azure.com[...] has an embedded bearer token (the value of the sig parameter in the URL). When you POST to that URL via CURL, Fiddler, Postman, etc. it works because that token is present.
However, when you click on a HttpPOST button in an actionable message, Outlook adds its own JWT token in the HTTP header, meaning that the HTTP POST has both a sig= bearer token in the URL and a JWT token in the HTTP header. Flow detects this and rejects the HTTP POST as invalid (while we don't currently support JWT tokens, we plan to, and treat this case as invalid to maintain forward compatibility).
This use case will work in the future. In the meantime, one workaround to try would be to have the actionable message buttons POST to your endpoints, e.g. https://yoursite.com/accept and https://yoursite.com/deny (validating the JWT as much as you like) and have these endpoints POST to Flow directly without the JWT.
Please let us know if that works.
BTW, the text you found is a documentation bug that has since been fixed:
Sorry for the confusion.

Can't get any G+ post's resharers with g+ api

According to this documentation https://developers.google.com/+/web/api/rest/latest/people/listByActivity
g+ api supports thing as "getting resharers of a post"
But i can't get it to work.
This is a post url - https://plus.google.com/u/0/+AseemTejpal/posts/PAcm67KwXaS it's have 22 resharers atm.
My steps (after authorizing and obtaining access token with scopes https://www.googleapis.com/auth/plus.login and
https://www.googleapis.com/auth/plus.me):
GET https://www.googleapis.com/plus/v1/activities/z13hypi4rtjjx5ko404chx4pwzikebbaliw/people/resharers?access_token={my_access_token}
by executing above request i'm getting:
{
"kind": "plus#peopleFeed",
"etag": "\"Sh4n9u6EtD24TM0RmWv7jTXojqc/RL739Eu8qXAJMlvqfIb_fYCs2JA\"",
"title": "Google+ People By Activity: Resharer",
"totalItems": 0,
"items": []
}
for instance, plusoners works fine
GET https://www.googleapis.com/plus/v1/activities/z13hypi4rtjjx5ko404chx4pwzikebbaliw/people/plusoners?access_token={my_access_token}
result: https://pastebin.com/5khY6cAp
What am i doing wrong? Why resharers request returns 0 results? Do G+ supports obtaining resharers by api at all?
Thanks.
It looks like that has not worked for a while. I doubtful if Google has any plans to fix it anytime soon.

Twitter API : Error "The validation of media ids failed." in update.json

I just want to post status with images with the twitter api and their not deprecated method:
https://api.twitter.com/1.1/statuses/update.json.
Before this, i successfuly upload my image with https://upload.twitter.com/1.1/media/upload.json, and i get my media_id.
Then, using the https://dev.twitter.com/rest/tools/console, i just use the update.json method, with the parameter status, and i add the parameter "media_ids", and put the media_id i received when i upload the image.
The response is a HTTP/1.1 400 Bad Request,
"errors": [
{
"code": 324,
"message": "The validation of media ids failed."
}
]
How can i upload multiple images using the api? After i success i want to do it via Twitterizer in c#, but first im trying to make it works in the rest console.
Thanks

Google Analytics dailyUploads not working with using google-api-ruby-client

I am using the google-api-ruby-client v0.7.1, ruby 2.1.
When I upload Custom Data Sources through Google Analytics API v3 with Google Analytics API v3 > analytics.management.dailyUploads.upload :
Request
POST https: //www.googleapis.com/analytics/v3/management/accounts/**********************/webproperties/**********************/customDataSources/**********************/dailyUploads/2014-04-06/uploads?appendNumber=1&type=cost&key={YOUR_API_KEY}
Authorization: Bearer **************************
X-JavaScript-User-Agent: Google APIs Explorer
Response
400 Bad Request
{
"error": {
"errors": [{"domain": "global",
"reason": "badRequest",
"message": "Upload request url should start with https://www.googleapis.com/upload/analytics/..."}],
"code": 400,
"message": "Upload request url should start with https://www.googleapis.com/upload/analytics/..."
}
}
That response I get when call this method of api from gem google-api-ruby-client too.
But the documentation states:
HTTP request
POST https: //www.googleapis.com/upload/analytics/v3/management/accounts...
But in Google APIs Explorer and gem request is https: //www.googleapis.com/analytics/v3... , not https://www.googleapis.com/upload/analytics/v3... .
Anyone encountered this problem and how to fix it?
You need to change
user and code value
In authorize method.
You'll get,
user_ID from client_secret.json
and
run the URL, you get in the console under 'Open the following URL in the browser' for code value

Resources