YouTube Live Streaming API doesn't allow to set enableEmbed to true, - youtube-api

While both documentation and API explorer apparently allows to do that setting enableEmbed to true fails with "Embed setting was invalid".
If already set to true (using the Studio UI) it is possible to update LiveBroadcast's contenDetails confirming enableEmbed to true so it looks that the change from API from false to true is what returns the error.
Any way to set enableEmbed to true as default for the account or to update the Broadcast with the desidered value?

Related

Slack Conversations API conversations.kick returning "channel_not_found" for a public channel

I am writing a Slack integration that can boot certain users out of public channels when certain conditions are met. I have added several OAuth scopes to the bot token, including the following:
channels:history
channels:manage
channels:read
chat:write
chat:write.public
groups:write
im:write
mpim:write
users:read
I am writing my bot in Python using the slack-bolt library and asyncio. However when I try to invoke this code:
await app.client.conversations_kick(channel=channel_id, user=user_id)
I get the following error:
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/conversations.kick)
The server responded with: {'ok': False, 'error': 'channel_not_found'}
I know for a fact that both the channel_id and user_id arguments I'm passing in are valid. The channel ID I'm using is the string C01PAE3DB0A. I know it is valid because I can use the very same value for channel_id in the following API call:
response = await app.client.conversations_info(channel=channel_id)
And when I call conversations_info like that I get all of the information about my channel. (The same is true for calling users_info with the user_id - it returns successfully.) So why is that when I pass my valid channel_id parameter to conversations_kick I consistently receive this channel_not_found error? What am I missing?
So I got in touch directly with Slack support about this and they confirmed that there is a bug on their end. Specifically, the bug is that I should have received a restricted_action error response instead of a channel_not_found response. Apparently this is a known issue that is on their backlog.
The reason the API call would (try to) return this restricted_action error is simply because there is a workspace setting that, by default, prevents non-admins from kicking people out of public channels. Furthermore, this setting can only be changed by the workspace owner - one tier above admins.
But assuming you are the owner of the Slack workspace, you simply have to log into the Settings & Permissions page, which should look something like this:
And then you have to change the setting labeled "People who can remove members from public channels" from "Workspace admins and owners only (default)" to "Everyone, except guests."
Once I made that change, my API calls started succeeding.

Slack bot scope not updating

I created a Slack bot using the "New App". Set it as a bot and am using the "OAuth Tokens for Your Workspace". With the following scopes under "Bot token scopes":
app_mentions:read
chat:write
chat:write.customize
files:read
files:write
groups:write
I added some of these permissions after the initial install (if it matters and you have to refresh something?). The bot is installed to a workspace and I have invited it to a private channel.
Using the example of the Slack API documentation:
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
slack_token = SLACK_TOKEN # xoxb-....
client = WebClient(token=slack_token)
try:
"""
response = client.files_upload(
channels="C040W4L2HA6",
file="test.txt",
title="Test upload"
)
"""
response = client.chat_postMessage(
channel="C040W4L2HA6",
text="Hello from your app! :tada:"
)
except SlackApiError as e:
# You will get a SlackApiError if "ok" is False
assert e.response["error"]
For both the file write and message examples I get: "ok":false,"error":"missing_scope","needed":"chat:write:bot","provided":"app_mentions:read" but "needed" changes from "chat:write:bot" to "file:write" if I run that part.
Few issues here. I am using the newest version of the client with Python 3.9 and it asks for a permission that is depricated (write:bot is just write now). In both cases it is as if my only active scope is app_mentions:read, nothing else. When I added the other scopes, I clicked "Request to install" and the person reviewing that accepted.
YAML config:
display_information:
name: BotName
description: Bot desc.
background_color: "#000000"
features:
bot_user:
display_name: botname
always_online: false
oauth_config:
scopes:
user:
- chat:write
bot:
- app_mentions:read
- chat:write
- files:write
- files:read
- groups:write
- chat:write.customize
settings:
interactivity:
is_enabled: true
org_deploy_enabled: false
socket_mode_enabled: true
token_rotation_enabled: false
Any ideas?
Under "Install app" I had to reinstall it to the workspace, it was not done automatically.

EdgeChromium extension chrome.tabs.query failing when only activeTabs permission is requested

I am trying to find the active tabs across all windows, actual query and action is more detailed but this demonstrates the basic problem
chrome.tabs.query({active: true}, function (tabs) { console.log(tabs); });
It seems that with Chrome and Firefox we can use that api with either activeTab or tab permission, only limitations on the search items such as url.
The chrome.tabs or browser.tabs docs only seem to indicate tab permission for some parts.
When using only activeTab permission MS Edge throws error, Chrome gives the result
Adding tabs permission and I can get the results in MS Edge
Is this a deliberate difference, or a bug, or doing something else incorrect?
Trying to ask for minimal permissions as Mozilla and Google required validation of usage with permissions with wide access.
similar to, but not the same as Why browser.tabs.query is not working in Edge Extension ?
first of all, you have to add 'tabs' permission to your manifest file like this
"permissions": [
"tabs"
]
and next use this code
let queryOptions = {
active: true,
currentWindow: true
};
chrome.tabs.query(queryOptions,function (tabs){
alert(tabs[0].url)
});
after that just remove the old extension and load new files in your extensions then observe the permission section in extension details it's should be changed and check it out.

redirectUrls does not exist on type 'Microsoft.DirectoryServices.WebApplication'

I'm using the Microsoft Beta Graph API to auto deploy dev env where I auto update a WebApplication's callback urls.
This has been working for a while has suddenly stopped working. As per https://github.com/microsoftgraph/microsoft-graph-docs/blob/master/api-reference/beta/resources/web.md it should accept redirectUrls under the web property.
{
"logoutUrl": "String",
"oauth2AllowImplicitFlow": true,
"redirectUrls": ["String"]
}
I am now getting the following error from microsoft graph api
The property 'redirectUrls' does not exist on type
'Microsoft.DirectoryServices.WebApplication'. Make sure to only use
property names that are defined by the type.
Also when querying the applications via https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/application it's no longer returning the redirectUrls under the web property.
I am confused?? Any suggestions?

Can't get views by insightTrafficSourceType — YouTube Analytics API

So I'm using the 'google-api-client' gem with Rails, and I'm attempting to call the URL below in order to get video views by day and insightTrafficSourceType. This is a call that appears to be allowable from the Available Reports documentation page.
Additionally, I found that I was able to make this call by using the API Explorer tool provided by Google.
URL:
https://www.googleapis.com/youtube/analytics/v1beta1/reports?metrics=views&ids=channel==CHANNEL_ID&dimensions=day,insightTrafficSourceType&filter=video==VIDEO_ID&start-date=2013-01-15&end-date=2013-01-16&start-time=1970-01-01
Result:
{
:error=>
{
"errors"=>[
{
"domain"=>"global",
"reason"=>"invalid",
"message"=>"Unknown identifier (insightTrafficSourceType) given in field parameters.dimensions."
}
],
"code"=>400,
"message"=>"Unknown identifier (insightTrafficSourceType) given in field parameters.dimensions."
}
}
I'm not sure what extra data I can provide in the initial description of this bug, but as stated before I am making the call to the API with the Google::APIClient Ruby library. The actual code itself looks like this:
client.execute(
:api_method => api.reports.query,
:parameters => options
)
You are still referencing the old beta API, i.e., in your URL, you have 'v1beta' and you should have 'v1' there. Try replacing that and running it again. Also, you can look at the api explorer to see the exact URL that should be generated in live examples with your acct (once you enable OAuth) here:
https://developers.google.com/youtube/analytics/v1/
(Look at the bottom of the page.)
Finally, start-time isn't a parameter listed on the production version of the API, so you will want to remove that as well.

Resources