title: Upload video to YouTube with CURL and API v3
body: <p>This is the function that I am using:</p>
  
  <pre><code>function uploadVideo($file, $title, $description, $tags, $categoryId, $privacy, $tokenacc){
  $direccionvideo = $_SERVER['DOCUMENT_ROOT'].'/uploadyt/mp4/'.$file;
  $video-&gt;snippet['title']         = $title;
  $video-&gt;snippet['description']   = $description;
  $video-&gt;snippet['categoryId']   = $categoryId;
  $video-&gt;snippet['tags']       = array($tags); // array
  
  $video-&gt;status['privacyStatus'] = $privacy;
  
  $res = json_encode($video);
  
  $parms = array(
  'part'  =&gt; 'snippet, status',
      'file'  =&gt; '@'.$direccionvideo,
      'body' =&gt; $res
  );
  
  $cabeceras = array('Authorization: Bearer '.$tokenacc, 'Content-Type: video/mp4');
  
  $ch = curl_init('https://www.googleapis.com/upload/youtube/v3/videos?part=snippet,status&amp;key=AIXXXXXXXXXXXXXXXXX');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $parms);
  curl_setopt($ch, CURLOPT_HTTPHEADER, $cabeceras);
  $return = curl_exec($ch);
  curl_close($ch);
  
  return $return;
  }
  </code></pre>
  
  <p>But it returns this:</p>
  
  <pre><code>{ "kind": "youtube#video", "etag": "\"rFqCJSkEICLP3Hq6a4AADI7kf48/Ppz1_LDXz9KAv4eC-UouSKrhjn4\"", "id": "XXXXXXXXX", "snippet": { "publishedAt": "2013-07-15T03:06:45.000Z", "channelId": "UCWXN1EzwIl2clMliTxxO7ww", **"title": "unknown"**, **"description": ""**, "thumbnails": { "default": { "url": "https://i1.ytimg.com/vi/XXXXXXXX/default.jpg" }, "medium": { "url": "https://i1.ytimg.com/vi/XXXXXXXX/mqdefault.jpg" }, "high": { "url": "https://i1.ytimg.com/vi/XXXXXXXX/hqdefault.jpg" } }, "channelTitle": "ChannelYouTube", "categoryId": "2" }, "status": { "uploadStatus": "uploaded", "privacyStatus": "public", "license": "youtube", "embeddable": true, "publicStatsViewable": true } }
  </code></pre>
  
  <p>Upload a video (which you can not be processed) with the title "unknown", without description, tags and category.</p>
  
  <p>It is as if the API does not take any post field.</p>
  
  <p>Can anyone help?</p>