Skip to content

Error creating live broadcast  #706

@camarrone

Description

@camarrone

I'm trying to create a live broadcast using the nodejs client library but I'm getting the following error:

{ Error: Title is required
    at Request._callback   code: 400,
.
.
.
  errors: 
   [ { domain: 'youtube.liveBroadcast',
       reason: 'titleRequired',
       message: 'Title is required',
       extendedHelp: 'https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/insert#request_body' } ] }

It's working on the API Explorer and that's getting me lost with this one. Here is the code:

var google = require('googleapis');
var OAuth2 = google.auth.OAuth2;
var youtube = google.youtube('v3');

var oauth2Client = new OAuth2(
  'xxxx', //CLIENT_ID
  'xxxx', //MY_CLIENT_SECRET,
  'http://localhost:3000/api/integrations/youtube'//YOUR_REDIRECT_URL
);

oauth2Client.setCredentials({
  access_token: "xxxx",
  refresh_token: "xxxx"

});

broadcastParams = {
    "auth": oauth2Client,
    "part": "snippet,status,contentDetails",
    "snippet": {
        "title": "Testing NodeJS",
        "scheduledStartTime": "2017-02-20T14:00:00.000Z",
        "scheduledEndTime": "2017-02-20T15:00:00.000Z",
    },
    "status": {
        "privacyStatus": "private",
    },
    "contentDetails": {
        "monitorStream": {
            "enableMonitorStream": true,
        }
    }
};


youtube.liveBroadcasts.insert(broadcastParams,  
function(err,broadcast) {
    if (err) {
        return console.log('Error creating broadcast: ', err);
    }
    console.log('Broadcast = ' + JSON.stringify(broadcast));
});

Thanks for the help!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions