JavaScript 400 Bad Request on Youtube API Update using AngularJS

Im trying to update a video's metadata using the Youtube API V3 in my AngularJS app. I am able to upload the video using insert.

I had unlimited problems trying to set the video metadata at the same time as uploading and kind of determined it just wasn't going to happen, unless anyone can tell me differently. The alternative is to set the metadata using the videos update action of the api https://developers.google.com/youtube/v3/docs/videos/update.

I'm recieving a 400 (Bad Request)

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "badContent",
    "message": "Unsupported content with type: application/json;charset=UTF-8"
   }
  ],
  "code": 400,
  "message": "Unsupported content with type: application/json;charset=UTF-8"
 }
}

Heres my $http request

$http({
  method: "PUT",
  url: "https://www.googleapis.com/upload/youtube/v3/videos?part=snippet,id",
  headers: {
    Authorization: 'Bearer ' + my_google_token
  },
  data: {
    id: "my_video_id",
    snippet: {
      title: "my video title",
      description: "my video description",
      tags: ['my','videos','tags'],
      categoryId: '17'
     }
   }
 }).then(function(response){
   console.log('success');
 },function(error){
   console.log(error);
 });
Answer:1

The correct answer is to not use $http and instead use the google provided library for youtube uploading in javascript.

Although somewhat confusing, the API reference/instructions page is here: https://developers.google.com/youtube/v3/code_samples/javascript#upload_video

Those code files can be found here on github: https://github.com/youtube/api-samples/tree/master/javascript

Answer:2

I'm working on making a wysiwyg editor using slate.js I'm in a situation where I'm trying to find the first node with text. This picture below shows what I'm talking about: Slate.js find first text ...

I'm working on making a wysiwyg editor using slate.js I'm in a situation where I'm trying to find the first node with text. This picture below shows what I'm talking about: Slate.js find first text ...

I have a function: function getNumber(number, array){ for(var i=0; i<array.length; i++){ if (array[i] == number) { return true; } else { return false; } } } console....

I have a function: function getNumber(number, array){ for(var i=0; i<array.length; i++){ if (array[i] == number) { return true; } else { return false; } } } console....

  1. check array length
  2. check array for value
  3. check array empty
  4. check array for duplicates
  5. check array empty javascript
  6. check array equality javascript
  7. check array of objects for value
  8. check array length python
  9. check array length php
  10. check array for duplicates javascript
  11. check array size
  12. check array is empty java
  13. check array length java
  14. check array size python
  15. check array empty python
  16. check array type python
  17. check arraylist is empty
  18. check array size java
  19. check array for string
  20. check array length bash

I would like to have a property dynamically accessed with a variable. For example, I have : data(){ redsection : '', bluesection : '', }, methods(){ changeColor(color, val){ ...

I would like to have a property dynamically accessed with a variable. For example, I have : data(){ redsection : '', bluesection : '', }, methods(){ changeColor(color, val){ ...

  1. vuejs pass variable to child component
  2. vuejs pass variable to component
  3. vuejs pass variable to css
  4. vuejs pass variable to parent
  5. vuejs pass variable to function
  6. vuejs pass variable to computed
  7. vuejs pass variable to method
  8. vuejs pass variable
  9. vuejs pass variable to child
  10. vuejs pass parameters to component
  11. vuejs router pass variable

I have a little problem here. ¿How i can manipulate a dynamically generated html, in Jquery? I have a function like: generatesomething : function(DestinationID,data){ result = $.DoSomething(data)...

I have a little problem here. ¿How i can manipulate a dynamically generated html, in Jquery? I have a function like: generatesomething : function(DestinationID,data){ result = $.DoSomething(data)...