2017-08-01 120 views
0

当我登录到雅虎双子座发布商信息中心(位于https://gemini.yahoo.com/publisher),我可以看到我所配置的发布者ID报告。我现在试图从Gemini REST API中获取这些相同的数据,但是我遇到了一些混淆和错误。如何获取Yahoo Gemini Publisher API报告?

根据https://developer.yahoo.com/gemini-publishers/docs/gemini-publisher-reporting.html我需要获得OAuth2访问令牌(我可以通过https://api.login.yahoo.com/oauth2/request_auth?client_id=GEMINI_CONSUMER_KEY&redirect_uri=MY_URL&response_type=token&language=en-us浏览器重定向成功完成),并拨打https://api.admanager.yahoo.com/v1/rest/reports/publisher/以获取报告。然而,当我这样做时,我得到一个神秘的回应:

curl --request POST \ 
    --url http://api.admanager.yahoo.com/v1/rest/reports/publisher/ \ 
    --header 'accept: application/json' \ 
    --header 'authorization: Bearer [omitted]' \ 
    --header 'content-type: application/json' \ 
    --data '{ ... cube JSON stuff ... }' 

{"error":{"lang":"en-US","description":"Please provide valid credentials. OAuth oauth_problem=\"additional_authorization_required\", realm=\"yahooapis.com\""}} 

OAuth令牌授予访问Gemini API的权限。我试图通过Explicit和Implicit方法获得OAuth令牌,结果相同。考虑到它可能是一个访问问题,我增加了对其他API授予的权限(配置文件,联系人等),但没有任何更改。

我注意到有上https://developer.yahoo.com/gemini/上市分离集合双子座的API。这些API位于https://api.gemini.yahoo.com/v2/rest/reports/custom/,当我向他们发布邮件时,它接受我的OAuth令牌,但是这些API的“多维数据集”需要一个“广告客户ID”,我不知道该从哪里得到或者如何使用正确的API。

{ 
"errors": [ 
    { 
     "errIndex": -1, 
     "code": "E40000_INVALID_INPUT", 
     "message": "Entity (publisher or advertiser id) not available", 
     "description": "" 
    } 
], 
"response": { ... } 
} 

该消息似乎表明我可以通过发布者ID,但是当我将它包含在“过滤器”中时,它不起作用。

当我打电话https://api.gemini.yahoo.com/v2/rest/advertiser/我没有收到广告回来。

,我应该使用哪个API?如果它是https://api.admanager.yahoo.com/v1/rest/reports/publisher/那么我是否省略了一些必需的请求数据,或者我得到的令牌是否错误?如果我应该使用https://api.gemini.yahoo.com/v2/rest/reports/custom/,那么我如何获取发布商数据(或我的“广告客户ID”)?

回答