作者: | 来源:互联网 | 2023-10-12 11:23
I'm using ScribeJava 6.9.0 for getting some Twitter statistics.
Most of my queries are executing OK:
https://api.twitter.com/1.1/account/settings.json
https://ads-api.twitter.com/6/accounts/...
...
But I have an error with one of them:
https://ads-api.twitter.com/6/stats/accounts/{account_id}/reach/campaigns?start_time=2019-11-01T21:00:00Z&campaign_ids={campaign_id}&end_time=2019-11-05T21:00:00Z
(in place of the {account_id} and {campaign_id} I send the real values).
In response to this request, I receive error 401 "Authorization required", with explanation: "UNAUTHORIZED_ACCESS", message - "This request is not properly authenticated".
The error remains the same if I remove any one of the time parameters (all of them are required in fact) and became 400 "Bad request", with explanation: "MISSING_PARAMETER", message "start_time" is a required parameter" in case of removing both of them (URL: https://ads-api.twitter.com/6/stats/accounts/{account_id}/reach/campaigns?campaign_ids={campaign_id}).
So I think that this is a library issue. I saw a similar issue here - #866 OAuthRequest - Twitter count param, without a solution. I don't use the "count" parameter intentionally but I suspect that it's not related to this parameter but to parameter processing in general.
该提问来源于开源项目:scribejava/scribejava
Have investigated a bit, it really seems to be out of ScribeJava's scope.
Composing requests are not ScribeJava's zone of responsibility, and it shouldn't make any transformation automaticaly. If I'm wrong, feel free to propose any changes.
Anyway, thanks for the information!