Googel Ads API Beta错误-即使指定了访问令牌,请求仍缺少必需的身份验证凭据

时间:2018-10-11 08:08:55

标签: node.js google-api google-oauth google-adwords

下面是我在Node Js中的代码。每当我发出GET请求时,我都会收到Request缺少必需的身份验证凭据作为响应的信息。

代码:

 var url =  'https://googleads.googleapis.com/v0/customers/myCustID?key=myKey';

 var newAcessToken = getGoogleAccessToken(refresh_token);

 var bearerToken = 'Bearer '+ newAcessToken;

 var  options = {
  url: url,
  headers: {
             'Authorization': bearerToken,
             'Accept': '*/*',
             'developer-token':  'myDevToken',
            },
            };


       request(options, function(err, response) {

           if(err)
            {
               console.log(error);
            }
            else
            {
                console.log(response.body);
                res.end();
            }});

0 个答案:

没有答案