How to get Youtube channel page id for creating Google BQ DTS - youtube

How to get YouTube channel page id for creating Google BigQuery Data Transfer Service YouTube Channel as data source.
Trying to create transfer service from BQ console and CLI. Getting the following error from console and CLI.
Now I am using the pageId from this YouTube Channel URL: https://www.youtube.com/channel/XXXXXXXXXYYYYYYYYYY
From CLI:
bq mk --transfer_config --project_id=test-dts --target_dataset=YTChannelDTS --display_name='YTChannelTest' --params='{"page_id":"XXXXXXXXXYYYYYYYYYY","table_suffix":"MT","configure_jobs":"true"}' --data_source='youtube_channel'
BigQuery error in mk operation: Request contains an invalid argument.
From Console: refer the below image(error marked in red colour).

Navigate to https://www.youtube.com/account_advanced in order to see your YouTube account settings. You will then see a value for YouTube Channel ID. This is what you pass to BigQuery.
Update: After trying to replicate the above steps on a project that I was the Owner on, I encountered the same error message. The workaround was to:
Go to the IAM admin page
Select the project that will be housing your data transfer BigQuery dataset
Find your account
Add the BigQuery Admin privilege to your account
Retry the steps to set up your data transfer

Besides "Channel page ID", the help button says that it needs "The page ID of the Google+ page associated with the channel."
You can get it by visiting Google plus and then clicking on profile. The pageID will get appended to the URL:
https://plus.google.com/< pageID >
I cannot fully test this because I have just set up a reporting job and it can take up to 48 hours to get created so, for me, right now it fails with a "No reporting jobs found - please ensure that reporting jobs exist." but it looks that the transfer itself was created correctly.
On a side note, Gplus will soon be discontinued for personal accounts so, for such transfers to still work after April 2 on such accounts, I think you'll probably need to "Move channel to Brand Account". This option can be found under Account settings

Related

'gcloud alpha iap oauth-brands create' getting INVALID PARAMETER

For some reason I deleted so called brand entity at my gcloud console. Now I want to create new one using the command in the console:
gcloud alpha iap oauth-brands create --application_title='EmojiRave' --support_email='rebelusgames#gmail.com'
But the console returns me back : INVALID_ARGUMENT: Request contains an invalid argument.
I've used different formats (using brackets and without them)
I've checked whether I have enough permissions to do it (I use owner account, so it's enough permissions)
I'm desperate.
There are two potential reasons for the failure:
1. Incorrect email address. According to the docs: "This [support] email address can either be a user's address or a Google Groups alias. [...] Note: The user issuing the request must be an owner of the specified support email address."
2. Project is not in an organisation. According to this source (see under limitations): If you're [..] outside a Cloud Orginization most likely you'll get an error on step "Creating oauth brand".
Overall, my suggestion is to update the OAuth Consent Screen via GCP Console.
Go to the Google Cloud Platform Console.
From the projects list, select a project or create a new one.
If the APIs & services page isn't already open, click on the Navigation Menu on the upper left and select APIs & services.
On the left, click OAuth Consent Screen.
Click Edit App.
First, it's not possible to delete the OAuth Consent Screen (Brand) once created. This can be seen from #DaImTo's answer, and the lack of delete option in both gcloud command and in the console.
I also tested your command on my Cloud Shell and it works fine as well. I've checked the documentation with regards gcloud alpha iap oauth-brands and it is currently in ALPHA state. It may change without prior notice and it may not be stable or work to all users. If you still want to use the CLI and request to be allow-listed regarding this command, my suggestion is to contact sales, as instructed on the issue tracker you've made.

Slack api conversations.history returns error: not_in_channel

I'm starting out with the Slack API and trying to just get a list of messages.
Here are my steps:
Created a Slack app and gave it channels:read and channels:history scope (also re-installed it)
Queried the list of channels with conversations.list (this worked fine)
From the output of conversations.list, I found a channel that I use and copied the id
Used the conversations.history api with the channelid from step 3
Result:
{ "ok": false, "error": "not_in_channel" }
I'm not at all sure what is happening here. I definitely have messages in the channel, and the documentation page for that api does not say anything about this "not_in_channel" error code.
What am I doing wrong?
After a long time of investigations (~2 hours), I found an easy approach. For Caleb's answer, I didn't understand how to invite a Bot to the channel. Hence, I am posting this answer.
Go to your Slack Channel and type the following as a message.
/invite #BOT_NAME
Eg: If your Bot name is SRE Incident Manager the command would be as follows.
/invite #sre_incident_manager
As soon as you start typing #, Slack will automatically suggest. So it becomes easy. For this, the Bot needs to be added to your Slack Workspace.
PS: Original answer.
The error not_in_channel has the exact meaning, your custom Slack app should be added to the channel.
Exact solution 1
To resolve the error, in the Web Slack interface:
Open channel settings
Click on the Integrations tab
Click Add apps and find your custom app.
Slack app might have different interface, see Iryna Vernik's answer.
Alternative solution 2
Give access to the bot to all channels by adding workspace wide scope, for example, chat:write.public. Depends on your needs and security requirements.
Alternative solution 3
To access the channel chat from API specify Incoming webhook. Slack will generate a unique URL with the token per each channel. Only convenient for a few channels.
This error arises when you are using the bot oauth token and the bot is not invited to the channel. To solve this you need to
Invite the bot(slack app) to join the channel.
Use the OAuth Access Token instead
To add Bot to your channel you need to write /invite #Bot_name in the slack channel
I also didn't understand how to invite a Bot to the channel. Way that was proposed by Caleb and Keet was not clear for me or not working. From my side, 'invite' work after
open channel
in Details tab, choose a 'More'clause
in dropdown menu, chouse an 'add app'
in pop-up look for you app (bot)
Also i was use Bot User OAuth Access Token, because i need this functionality in private channel (additionaly, you should add for bot groups:history scope)
FOr me, instead of invite a user/bot, I invite the app.
I'm getting started with the Slack API as well, and I've come to realize that not_in_channel simply means that the user/bot you are using the token for hasn't joined that particular channel you're trying to perform an action on.
Think of it this way: if you're using Slack on the web-browser or web-app, you wouldn't be able to post a message on a channel you haven't either joined or was invited to.
☝️ You'll also never run into this issue through the Slack UI/UX because you're not even able to access the channels UNTIL you are invited or join it.
Click to see png example of a slack message stating my bot being added to a channel
However, because we're using the API we can essentially skip some steps, and in this case we skipped the step where a user/bot has joined the channel before doing the action we're trying to perform (writing a message, grabbing information, etc).
πŸ’ͺ How to address this
There's probably plenty of ways to do it that I'm not versed in, but if you're just concerned about a specific channel or two without the concern of scaling to x channels I'll list the way that worked for me.
πŸ“‡ /invite Slash Command
As others have mentioned, putting /invite in the message box lets you use Slack's slash command shortcut to add users. What's important is this way also allows us to invite bots to the channel.
Putting "#" triggers Slack to start auto-suggesting, which is why it then becomes easy to find your bot name in the list.
Click here to see screenshot example of the /invite command with #bot_name_here
Hope this helps answer people's question on why it's happening, and thank you to the original posts that got me out of my initial mess. πŸ™
As all others said, you need to join each channel.
The bot can join channel programmatically by using API below:
https://api.slack.com/methods/conversations.join
Don't forget to add permission of conversations.join

Getting Unable to retrieve user's mysite URL even if the drive exists

When querying the Graph with the PHP library for a given drive I receive 400 Unable to retrieve user's mysite URL or 429 Too many requests.
When I call for example https://graph.microsoft.com/v1.0/users/b0633c25-2655-4dfe-a2b2-078e4310deba/drive with the PHP library it gives this weird result. When I query the same url in the Graph Explorer. It works like a charm.
I've set up the permissions as described in the docs and have the E3 Developers subscription that is still valid.
What am I missing?
The error message is misleading and does not mention billing as it should.
Check your Billing > Your Products (subscription) in your Microsoft 365 Admin and then try again.
The best way to test is:
https://developer.microsoft.com/en-us/graph/graph-explorer
The current error seems like user does not have ODFB(OneDrive For Business) site created, you can check if the user have create OneDrive site(the OneDrive site will be created while the user first time to use it).
To debug that issue for now, try to use Graph Explorer https://developer.microsoft.com/en-us/graph/graph-explorer# and login with your user account.
If you can access /me then try accessing /me/drive/root and you will get details about ODFB Doc Lib for current user if it exist.
we can get results with the following link for login-in user
https://graph.microsoft.com/v1.0/me/drive/root/children
Reference for you: https://github.com/microsoftgraph/microsoft-graph-docs/issues/1354

Log Analytics API does not show in the AAD registered app API list

I'm using Azure Log Analytics to write application logs to it, like trace and error logs and also audit logs.
I would need to be able to query this log data in my web application in a flexible way (no static searches), so I came up to their REST API, like described here:
https://dev.loganalytics.io/
For some reason the authentication for query the data is different than inserting new data to the log, which I already did successfully with building a signature using the workspace id and key.
According to the documentation when using the search API I need to register my app with their AAD service, so I tried to follow the steps described in here:
https://dev.loganalytics.io/documentation/Authorization/AAD-Setup
My log analytics registration:
Log analytics registration
So I tried to create the app registration and tried to add permissions:
App Registration
And then I want to choose "Log Analytics" in the API access - but "Log Analytics" is not listed there!
As can see in this image:
API List
Why Log Analytics is not listed here? Am I'm doing something wrong?
You need search for Log Analytics API in the "Select an API" menu, then you could see this. It is not in the default list.

Deep Link error

Trying to deep link from a mediawiki uri to a slack channel using
slack://channel?team={TEAM_ID}&id={CHANNEL_ID}
I'm confident in both TEAM_ID and CHANNEL_ID, and slack app opens, but I get a slack error
You tried to perform an action on a team you’re not yet logged into! Sorry, no can do :/
I'm actually looking at the target team when I get the error displayed.
Thoughts?
Make sure you enter the TEAM_ID which is completely different from the team name.
Just log in to your Slack team in a browser, open the developer tools and watch the console, you'll see both USER_ID and TEAM_ID as following:
2017/9/4 14:37:52.747 BOOT: Finished first boot 3247 ms after DOM ready
2017/9/4 14:37:52.747 User id: U02A6ESU2, team id: T10A2F3GM
2017/9/4 14:37:54.578 Finished processing users.counts
2017/9/4 14:37:54.578 0 IMs with unreads, 0 total dm_count

Resources