It is important to read the error response that is returned by the Google Analytics API server. In a lot of cases they can tell you exactly what is wrong.
400 invalidParameter
{
"error": {
"errors": [
{
"domain": "global",
"reason&...