I have created a Youtube small web application using the Youtube API. The application sends messages to my customers, and if a message is not sent successfully i print the Youtube error to know where is the problem, through this code :
try { // Send the message.
$sentMessage = $yt->sendVideoMessage( $body, null, $videoId, $customerName );
} catch (Zend_Gdata_App_HttpException $e) {
$errorReport .= "- YouTube Error: " . $e->getRawResponseBody() . "\n";
}
Some messages are being sent fine, but sometimes strange Youtube errors are being print, and i can’t figure out where the problem is. For example it prints :
- YouTube Error: 11
Validation failed
And this sometimes :
- YouTube Error: 9
Forbidden
Is there a guide that refers to these error numbers, so i can fix my code according to their meaning ?
After a lot of investigation i found what those 2 errors mean :
This error occurred because there was a missing character in the video id. It was typed wrong, so this error seems to occur if there was some wrong entry in the sendVideoMessage(…) parameters.
This error occurs because i have sent too many messages at the same time, so Youtube thought i am sending spam messages.
That took some time, but now things are fixed 🙂
If someone knows a guide explaining all possible Youtube API errors, please share it so everyone can benefit from that.