当我登录到 Yahoo Gemini Publisher 仪表板(位于https://gemini.yahoo.com/publisher)时,我可以看到我已配置的 Publisher ID 的报告。我现在正试图从 Gemini REST 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 的访问权限。我尝试通过显式和隐式方法获取 OAuth 令牌,结果相同。考虑到这可能是访问问题,我也增加了授予其他 API(个人资料、联系人等)的权限,而没有任何变化。
我注意到https://developer.yahoo.com/gemini/上列出了一组单独的 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”)?