当我登录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")?
发布于 2017-08-04 21:56:09
显然,雅虎已经弃用了Gemini发布API,并将这一功能转移到了Flurry (后者的API需要不同的身份验证)。https://developer.yahoo.com/flurry/docs/api/code/publishing/
https://stackoverflow.com/questions/45445095
复制相似问题