Randal Pinto
Randal Pinto

Reputation: 11

oauth.io invalidArgument error

I am attempting the following request:

OAuth.popup('google').done(function(google) {
        google.post('/gmail/v1/users/me/labels', {
            data: JSON.stringify({
                userId: 'me',
                label: {
                    name: 'SmartMail'
                }
            }),
            dataType: 'json', 
            contentType: 'application/json; charset=utf8' 
        }).done(function (result) {
            console.log('result: ', result);
        }).fail(function (error) {
            console.error('error: ', error);
        });
    }).fail(function(err) {
        console.error('google: fail', err);
    });

Which is as per this example: oauth.io subscribe user to youtube channel

However I get the following error back:

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "invalidArgument",
        "message": "Invalid request"
      }
    ],
    "code": 400,
    "message": "Invalid request"
  }
}

Any idea what's wrong with it?

Upvotes: 0

Views: 34

Answers (1)

Randal Pinto
Randal Pinto

Reputation: 11

Disregard. Confusing Gmail documentation.

Upvotes: 0

Related Questions