Twilio API Exporting Sub Accounts - twilio

Is there an api endpoint to GET all sub accounts of an account? I'm trying to export the list at this location in the twilio browser console:
https://www.twilio.com/console/project/subaccounts.
Since I couldn't find a way to export it, I assumed there might be an endpoint for this data in their api, but I can't seem to find any api docs that reference sub accounts.

Here is the resource.
List All Accounts
Read the set of Accounts belonging to the Account used to make the API
request. This list includes that account, along with any subaccounts
belonging to it.

Related

Is there a way of getting ID(s) of youtube channels linked to a user in discord.js?

I was thinking about implementing a command that would show you some basic stats of a channel linked to your discord account. Is there a way of getting an ID of a channel linked to your discord account or no? I tried logging the user and member objects, but I can't really find it there, but there could be a different way of getting it.
Thanks.
You are not able to get linked accounts, you will have to get them to verify it with OAuth2 yourself and store the information in your database.
Discord doens't make this public.

twilio how to get possible users

I retrieved an access token from my server and have connected the JavaScript SDk chat client like so. I have created a channel like so. The next step I'd like to invite a user like this. In that example they invite the user 'elmo'. Where do I get 'elmo' or how do I present the user with a selection of possible 'elmo's? The client sdk has no list users functionality.
Edit:
It looks like the REST API has a list users method. But can't find any examples of it used. Should the 1st person chat client be using the REST API as well to supplement gaps in the client SDK or should it get the identity from backend? Our team has different interpretations of the docs: twilio REST API is strictly for backend vs. twilio REST API can and should be used any where. Moved to twilio REST API: strictly backend?
Twilio developer evangelist here.
In my opinion Twilio's Chat API should not be the central source of truth of the users in your system. I don't know anything more about your application than what you've written here, but I would expect that you have a user model within your own system that you have used to generate or create an identity that is then used by the Chat API as well as how your user logs in to your system. I would then use that user model to connect users and provide their identities so that they can join chats together.

YouTube API - List all channels that I manage

I have a YouTube channel for my personal account, and one for my business account. I have associated a Google+ page to both channels. In the business account, I have clicked "Managers" (in the drop down in the top right), and added my personal gmail account as a Manager. This has all worked fine.
Now, though, I am trying to use the YouTube API to list all of the channels that my personal account has rights to manage. I'm trying to use the Google Developer's page here https://developers.google.com/youtube/v3/docs/channels/list#try-it but it is only returning the one channel that is directly associated with my personal account. I'd expect it to return both the personal channel and the business channel.
Is there a way, an api call, or a setting that will allow me to make a single api call for an oauth user and see all of the YouTube channels / Google+ Pages that the user has permissions to manage?
I you are using the WebView for authentication, the user has to choose the YouTube account to be used. The channel will then be returned. If you are using Android OAuth, the only way to specify a channel is for the user to select the "default channel" in the advanced YouTube account settings.
http://youtube-eng.blogspot.de/2013/06/google-page-identities-and-youtube-api_24.html
I don't think that you can manage different accounts (even if they have linked to eachother) with the same API key. Sub-channels can be managed with the same API key with main channel. Which version of API are you using?

Need help obtaining Content Owner Id

I'm struggling with retrieving the Content Owner-based YouTube Analytics Data. From this discussion (Obtaining the current user's YouTube content owner id), I learned that I need to query youtubePartner.contentOwners.list(fetchMine=true) to obtain the content owner info, of which the Id will be found.
My struggle is that when I call youtubePartner.contentOwners.list(fetchMine=true), I receive the reason "accessNotConfigured". I'm not sure why: I have YouTube Analytics enabled in the APIs Console for my app, and I have the https://www.googleapis.com/auth/youtubepartner scope configured in OAuth2 list of scopes during authentication.
Can anyone help me understand what I'm doing wrong?
You may have not enabled Partner API in your devconsole or your account may not be linked to a CMS account.

Using the YouTube Analytics API with a CMS account

I'm getting a 403 Forbidden error when trying to get youtube analytics api data using a CMS account.
Just to confirm, is a CMS account the same thing as a Service account?
I can get analytics data for channels that are owned by the oauth2 user but I get the 403 on any other channels that I have access to through my CMS account but am not the content owner of. (I have Administrator account level on the CMS account and the channels I get 403 error on have "Managed" relationship)
Question: Are there any plans to have youtube.analytics api support for querying channels managed under a CMS account?
It seems that since I can use that account to get all the analytics data for these channels using the CMS UI that I should be able to do the same using the API.
A YouTube Content Management System account is not the same thing as a Service Account. You won't get far with the YouTube APIs if you authenticate as a Service Account, since that Service Account won't have access to any actual YouTube channels. Authenticating as a CMS account, however, will give you what you want.
A lot of this recently made it into production, so let me lay out the full steps here explaining how folks with YouTube CMS access can run YouTube Analytics API reports against the channels and videos they manage.
(Optional) While authorized via OAuth 2 as the CMS account, using both the https://www.googleapis.com/auth/youtube.readonly and https://www.googleapis.com/auth/youtubepartner scopes, make a YouTube Data API v3 channels.list() call with the following parameters: part=snippet,contentDetails, managedByMe=true, maxResults=50, onBehalfOfContentOwner=CONTENT_OWNER_ID. CONTENT_OWNER_ID is the one value that you'll have to hardcode here, and it should be set to the "partner code" for your YouTube CMS account. This will give you back a list of up to 50 channels that your CMS account manages. (If you need more than 50, you'll need to page through the results.) The id of each channel will be returned in channel.id, and other useful information (like the uploads list id, if you want to get the list of videos in that channel) will also be returned.
If you already know the UC... channel id for the channel you want to run reports against, you could skip that step and go directly to the Analytics report.
To run a channel-level report on a managed channel, while authorized as the CMS account, make a YouTube Analytics API request with the following parameters: ids=contentOwner==CONTENT_OWNER_ID, filters=channel==UC..., and then any other report parameters you want.
To run a video-level report, set ids=contentOwner==CONTENT_OWNER_ID and filters=video==VIDEO_ID, where VIDEO_ID is the id of any video in any channel that the CMS account manages.
There are more details about content owner reports in the docs.

Resources