Ads API access

ads
twitter4j

#1

will you please check weather my App ID have an Ads API access?
APP ID : 13505677

When i am try to get response of
"https://ads-api.twitter.com/1/insights/18########" i got an error,

{“errors”:[{“code”:“UNAUTHORIZED_CLIENT_APPLICATION”,“message”:“The client application making this request does not have access to this API”}],“request”:{“params”:{}}}

Please check it.


#2

@BSDarandale1111: Yes that app has been granted access to the Ads API.

The endpoint you’re trying to access likely requires whitelisting. However, it’s difficult to know without seeing the entire resource path. Please post the full request, including the account ID, so that we can further investigate. See our Guidelines for Reporting Issues post.


#3

Twitter4j Ads API request

BaseAdsListResponseIterable allTwitterEntityStats = statApi.fetchStatsSync(“18ce548hnmt”, TwitterEntityType.CAMPAIGN, Lists.newArrayList(“6ngar”), since, until, Boolean.TRUE, Granularity.TOTAL, TwitterAdObjective.TWEET_ENGAGEMENTS, Placement.ALL_ON_TWITTER);

“errors”:[{“code”:“INVALID_TIME_WINDOW”,“message”:“Time cannot be fractional hours”,“parameter”:“end_time”},{“code”:“INVALID_TIME_WINDOW”,“message”:“Time cannot be fractional hours”,“parameter”:“start_time”}],“request”:{“params”:{“start_time”:“2017-03-14T18:30:00Z”,“entity_ids”:[“6ngar”],“end_time”:“2017-03-17T18:30:00Z”,“placement”:“ALL_ON_TWITTER”,“account_id”:“18ce548hnmt”,“granularity”:“TOTAL”,“entity”:“CAMPAIGN”,“metric_groups”:[“ENGAGEMENT”,“BILLING”,“MEDIA”]}}


#4

Please note:

The endpoint can only be called with whole hours - Source

But note that that’s a different request from the one in your original post.


#5

https://ads-api.twitter.com/1/insights/18ce548hnmt

I tried to request it on API console but throwing error
please check


#7

How to pass whole hours ??@juanshishido


#8

@BSDarandale1111: To do this, set the minutes to zero, like so: start_time=2017-03-14T18:00:00Z&end_time=2017-03-17T18:00:00Z.


#9

Thank you @juanshishido
Need one little help,
In “Twitter4j-ads” there is no twitter objective “Awareness”,so how to get such campaign stats using Twitter4j-ads?