Youtube default LiveBroadcast being created without a bound stream ID - youtube

As part of our application flow, we create default LiveBroadcasts for the users to stream too. For most of our users the default LiveBroadcasts are automatically bound to the default LiveStreams, however a few users have default LiveBroadcasts that don't bind automatically.
I attempted to bind to a non-default LiveStream (since there seems to be no way to find the default LiveStream) and I get a 403 with an error message liveBroadcastBindingNotAllowed: The binding is not allowed.
Since there is no stream bound, we are unable to stream to that LiveBroadcast and our users are getting errors. Is there any workaround or fix for this?

I have encountered a similar issue as well. When listing all broadcasts via the following:
curl \
'https://www.googleapis.com/youtube/v3/liveBroadcasts?part=id%2Csnippet%2CcontentDetails%2Cstatus&broadcastType=all&mine=true&key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
Some of our users are getting more than one broadcast where snippet.defaultBroadcast is true, but only one of these persistent broadcasts actually have a valid contentDetails.boundStreamId, the others simply omit the property. For my personal account, if I change the broadcastType from all to persistent, then I'm able to get just the one true default broadcast which has a valid contentDetails.boundStreamId. Here is an example request:
curl \
'https://www.googleapis.com/youtube/v3/liveBroadcasts?part=id%2Csnippet%2CcontentDetails%2Cstatus&broadcastType=persistent&mine=true&key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
I'm not sure yet if it's a fluke that it happens to choose the correct persistent broadcast. I am going to contact some of our users to help me troubleshoot this, I know of one that has at least 3 persistent broadcasts in the response from the API.

Related

Ratpack/Groovy - read the body of a call

I want to create a "mock" server using Ratpack/Groovy and we need to read the data-raw from a call
I haven't had a problem reading headers or parameters, but I need to read the body of a request
Examplle:
curl --location --POST request 'http://localhost:5050/authenticate' \
--header 'Content-type: application/json' \
--raw-data '{
"username": "testbase01#domain.com",
"password": "12345678"
}'
we need to parse and process the username and password fields
We have tried to read the request.body, or the body.text, but we have not been successful.
Basically the example found in the solution at https://stackoverflow.com/questions/23636248/parse-json-in-ratpack-groovy would be what we need, but it hasn't worked for us either
Our environment has the following dependencies
#Grab('io.ratpack:ratpack-groovy:1.6.1'),
#Grab('org.slf4j:slf4j-simple:1.7.22'),
#Grab("io.ratpack:ratpack-jackson:0.9.17")
and we are using https://github.com/Vad1mo/hello-world-rest as primary image
If you have a small example, to be able to adapt it to our needs

How to get userId for a given user in ADO using Azure DevOps API

I have a requirement to add userId in the request body to add discussion in ADO , so any pointers how to get userId in ADO?
Use this API:
https://learn.microsoft.com/en-us/rest/api/azure/devops/graph/users/list?view=azure-devops-rest-6.0&tabs=HTTP
Sample:
curl --location --request GET 'https://vssps.dev.azure.com/<Organization Name>/_apis/graph/users?api-version=6.0-preview.1' \
--header 'Authorization: Basic <Personal Access Token>'

How to total number of users in JIRA Cloud REST API?

When we try to get all users in JIRA REST API, we get response with maxResult of 50. But the thing is that how can I know how many total users are there in total? We do not get that in either response or in header, so how to know the total?
It's returning maxResult of 50 because it is the default behaviour of the Get All Users REST API.
Have you tried passing the maxResult as a query parameter like:
curl --request GET \
--url 'https://your-domain.atlassian.net/rest/api/2/users?maxResult=100' \
--user 'email#example.com:<api_token>' \
--header 'Accept: application/json'
As mentioned in the REST API doc

Youtube api video search Request contains an invalid argument

I am trying to search youtube videos as per here: https://developers.google.com/youtube/v3/docs/search/list
This is my request:
https://www.googleapis.com/youtube/v3/search?part=id,snippet&type=video&videoEmbeddable=true&channelId=UUUhFaUpnq31m6TNX2VKVSVA&maxResults=6&order=relevance&q=bmw&key=API_KEY
I am getting "Request contains an invalid argument."
It works if I remove channelId but this parameter is supported as per docs. I need to have this parameter because I want to narrow down search in channel.
Btw, this request works in their API panel and returns results:
curl
'https://youtube.googleapis.com/youtube/v3/search?part=id&part=snippet&channelId=UCUhFaUpnq31m6TNX2VKVSVA&maxResults=6&order=relevance&q=bmw&type=video&videoEmbeddable=true&key=[YOUR_API_KEY]'
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]'
--header 'Accept: application/json'
--compressed

How to update user model from api in rails?

I am new to rails and i want to produce json response for iPhone app from server. I have user model where they can get the current user information after login using the token
curl -H 'Content-Type: application/json' -H 'Accept:
application/json' -X GET htt://localhost:3000/profile.json -d
"{"user" : { "auth_token" : "asjyWYeyVHDJrg746h" }}"
this provides the user information, similarly how can the user be edited or updated by passing the values that are to be changed.Please help me.
Look at Grape. Also read about respond_to :json

Resources