代码之家  ›  专栏  ›  技术社区  ›  Padma

从Java调用Google adwords api

  •  0
  • Padma  · 技术社区  · 7 年前

    我正在尝试运行简单的GetCampaigns。java获取使用谷歌API的活动列表。我能够将谷歌提供的API下载到eclipse中,在代码方面似乎一切都很好,但当我在eclipse中运行代码时,出现了错误

     Exception in thread "main" AxisFault
     faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
     faultSubcode: 
     faultString: [QuotaCheckError.DEVELOPER_TOKEN_NOT_APPROVED @ ; trigger:'<null>']
     faultActor: 
     faultNode: 
     faultDetail: 
        https://adwords.google.com/api/adwords/cm/v201710}ApiExceptionFault:<message>[QuotaCheckError.DEVELOPER_TOKEN_NOT_APPROVED @ ; trigger:'&lt;null&gt;']</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="QuotaCheckError"><fieldPath/><trigger>&lt;null&gt;</trigger><errorString>QuotaCheckError.DEVELOPER_TOKEN_NOT_APPROVED</errorString><ApiError.Type>QuotaCheckError</ApiError.Type><reason>DEVELOPER_TOKEN_NOT_APPROVED</reason></errors>
    

    我已经完成了中提到的所有步骤 Request a developer token

    并相应地更新了ads.properties文件,但仍然没有成功

    ads.properties文件的片段

    api.adwords.developerToken=123axxxxxxxxxxxxxxxxxx
    api.adwords.clientId=xxxxxxxxxx.apps.googleusercontent.com
    api.adwords.clientSecret=zZxxxxxTxxxxxxxxxxx
    api.adwords.clientCustomerId=123-456-7890
    api.adwords.refreshToken=1/dyOIp7ki-xxxxxxxxxxxxxxxxxxxxxxxx
    

    有人能帮我使代码正常工作吗

    1 回复  |  直到 7 年前
        1
  •  1
  •   Padma    7 年前

    在使用不同的帐户后,它开始工作,因为之前我试图查询不包含任何活动的MCC帐户,因此我创建了一个新帐户,并使用它来查询活动及其工作情况。