Set the channelSection country using the YouTube API - youtube-api

I have a YouTube channel. Within that channel I have a channelSection called "Brazil".
I want to limit that section so that only people in Brazil can view it.
In the documentation I see how to set the country parameter for a channel, but not a channelSection.
Per documentation: https://developers.google.com/youtube/v3/docs/channelSections/update
The only items I can update are:
snippet.type
snippet.style
snippet.title
snippet.position
contentDetails.playlists[]
contentDetails.channels[]
targeting.countries[]
targeting.languages[]
targeting.regions[]
Our YouTube rep wrote to us that "To set the snippet.country property for a channel resource, you actually need to update the brandingSettings.channel.country property. This setting does not affect targeting in any way."
So I am a bit confused. Do I set the channel's brandingSettings.channel.country setting to Brazil or the channelSection, and if so, how?
Update
Following the answer below, I receive the following error:
"domain": "global", "reason": "backendError", "message": "Backend Error"

I think they might've been confused about what you were trying to do. Changing the brandingSettings.channel property should only set
the country with which the channel is associated. [source]
I believe the correct way to do what you're asking is by adding "Brazil" to the targeting.regions[] list.
From the documentation:
targeting.countries[]: A list of ISO 3166-1 alpha-2 country codes
where the channel section is visible. [source]
Since you've already created the channelSection, you'd just use channelSections.update() to provide a channelSection resource and specify Brazil for the targeting country. According to the ISO 3166-1 country code list, the code for Brazil is "BR". Note that if you are submitting an update request and your request does not specify a value for a property that already has a value, the property's existing value will be deleted.
Afterwards, you can use channelSections.list() to check your channelSection resource and see that it should only be visible to users in Brazil (targeting.countries[] should have "BR" as the only value). Or maybe you could use some proxy extension to view the channel section from different countries to see if it's working as expected.

Related

commentThreads with chennel-ID parameter returns 403 error that refers to Video Id

While calling the commentThreads API with a channelId is a parameter.
I'm getting commentsDisabled (403) error - which refers to "The video identified by the videoId parameter has disabled comments." However, as I indicated I'm using the channel ID.
I tested some other channels - that do have disabled videos - and I did not get that error.
I get it on a few specific channels.
Please advise.
TLDR: There isn't anymore any way to retrieve community tab comments.
Here are some channel ids in line with what you were stating:
Request: https://www.googleapis.com/youtube/v3/commentThreads?channelId=UCWIdqSQekeGmUWlSFeCiEnA&key=YOUR_API_KEY
Answer: 403 The video identified by the <code>videoId</code> parameter has disabled comments.
However there is a video with comments: https://youtu.be/3F8dFt8LsXY
Request: https://www.googleapis.com/youtube/v3/commentThreads?channelId=UCXptamDYEVcU4JCio30hYTw&key=YOUR_API_KEY
Answer: 403 The video identified by the <code>videoId</code> parameter has disabled comments.
Furthermore there isn't any public video with comments (checked by algorithm based on the "uploads" playlist)
channelId field isn't about videos so videos restriction shouldn't change visibility of the community tab (that's comments from this section that we retrieved with the channelId field)
The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.)
On both channels above, they have their community tab disabled.
However after tests on "normal" channels like officialpsy there isn't any error in the answer however there isn't any comment either.
If you are looking for community tab comments I would recommend you to use allThreadsRelatedToChannelId which works but will also return you comments left on videos.
However even allThreadsRelatedToChannelId doesn't seem to work anymore for community tab comments https://www.googleapis.com/youtube/v3/commentThreads?allThreadsRelatedToChannelId=UCMD4joGtfFO5DoH_GeRP4Cg&key=YOUR_API_KEY

List channel subscriptions returns only my channel

So, I have a request that should list my subscribers who do not have the private subscriptions option enable. My request is:
response = youtube.subscriptions().list(
part="snippet",
maxResults=50,
mySubscribers=True
).execute()
However, in items resource, every channel returned is my own channel. My channel name, ID and profile images. Is this the problem with the API or am I making a wrong request?
I also tried using the Try this API option on the documentation, but it also returns the same result.
https://developers.google.com/youtube/v3/docs/subscriptions/list
Thank you for any help you can give
According to the official docs you already quoted, you should have passed to your API call the parameter part as:
part="snippet,subscriberSnippet".
The subscriberSnippet part gives you the needed info:
subscriberSnippet (object)
The subscriberSnippet object contains basic details about the subscriber.
For what concerns the snippet part, the official doc is indeed a bit ambiguous:
snippet (object)
The snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to.
Nevertheless, the info you get from part="snippet" only is correct.

Eventbrite API get full description

When using an eventbrite api end point e.g.
https://www.eventbriteapi.com/v3/events/11111/?token=xxx
I only get the summary description e.g.
"description": {
"text": "Short description",
"html": "Short description"
},
Is there a way to get the full description?
That is strange... I ran a call to the API and I received a full description.
*Note: The description was on multiple lines.
Can you share the event_id this is happening to?
*Also, Note: I am using iTerm, Python with the requests package, and pretty print package(pprint) to make my calls to the API. Could this be a settings issue with the tool you are using to make the calls?
This is mentioned about the retrieve event endpoint.
Note: If the Event being retrieved was created using the new version of Create, then you may notice that the Event’s description field is now being used to hold the event summary. To retrieve your event’s fully-rendered HTML description, you will need to make an additional API call to retrieve the Event's full HTML description.
So, to fetch an events description, use this endpoint:
https://www.eventbrite.com/platform/api#/reference/event/retrieve/retrieve-event-html-description
This is the endpoint, in case someone gets here after Jul 2020 https://www.eventbriteapi.com/v3/events/event_id/description/
I had the same issue and found this on the official documentation: Retrieve full HTML description.
The reason is that, as mentioned in Sheldon's answer (and here in docs):
To retrieve your event’s fully-rendered HTML description, you will need to make an additional API call to retrieve the Event's full HTML description.

Select fields on Microsoft Graph list of Messages

I'm using Microsoft Graph to get a list of messages for a user.
I'm using the following URL
https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages
One important thing that is returned by this is the meetingMessageType when the message revolves around a meeting request.
I would also like to get the uniqueBody of the message. However, that's not provided by default. One needs to specifically ask for that field. I can do that by adding ?$select=uniqueBody to the URL.
However, that now means that I need to add the rest of the fields I want to the $select query parameter. That's not a big deal until I run into meetingMessageType. Microsoft Graph returns:
Could not find a property named 'meetingMessageType' on type 'Microsoft.OutlookServices.Message'.
What can I do to ensure I get both uniqueBody and meetingMessageType?
Try this:
$select=uniqueBody, microsoft.graph.eventMessage/meetingMessageType
Yogesh's answer is close but will result in a Only one level select is supported error.
As long as you don't care about the value of meetingMessageType, you can use this select:
$select=microsoft.graph.eventMessage, uniqueBody
You'll note that the results no longer include meetingMessageType as a property. The list however is limited to only those messages that are eventMessage, effectively giving you a result set filtered to only show meeting requests.

channels.list response body has no invideoPromotion object

in revision of August 15, 2013 says that "The API now supports the ability to specify a website as a promoted item." reflecting details with "invideoPromotion" object.I need to get the items set.
However when i call the method as below,almost for 10 channels, none of them has the mentioned promoted item.
https://www.googleapis.com/youtube/v3/channels?part=id,status,snippet,brandingSettings,contentDetails,invideoPromotion,statistics,topicDetails&forUsername={CHANNEL}&key={API-KEY}
Is there a specific query parameter for it?
I believe you can only get your own channel's invideoPromotion settings.
Here's a video talking about invideoPromotion.
Also here's a JAVA Sample code.

Resources