I'm trying to get the Ad Spent for an AD Account based on Dates Range Interval.
I can get it for today or for yesterday but couldnt find a way to get it for a specific interval. I've tried the date_preset parameter but it works only for yesterday/today. Also tried with time_range. Couldnt figure it out.
curl -i -X GET \
"https://graph.facebook.com/v3.2/act_{ad_account_id}/insights?fields=spend&access_token={access_token}&date_preset=today"
Solved!
The parameters used for date range are the following:
time_range[since]=2018-10-20&time_range[until]=2018-10-25
Solved!
The parameters used for date range are the following:
time_range[since]=2018-10-20&time_range[until]=2018-10-25
Related
I was trying to run the following code and I get variable number of tweets when I keep running the code at some interval of time (more than 15min). Sometimes I get 1400 tweets and 1200,1000,1600 tweets the other time. Can't I get fixed number of tweets all the time I run the code even if i change the keyword?
for tweet in tweepy.Cursor(api.search, q="#narendramodi", rpp=100).items(200):
You search does not specify any id limit.
Because of pagination, Twitter Search API looks for latest tweets every time you call it. Since tweets are added continuously, simple call to Search API returns the most recent ones and you'll get different number of tweets based on how many tweets were posted during the time you were querying. See Working with Timelines.
Please also note that Twitter Search API focuses on relevance rather than completeness of the results. See The Search API.
If you want to iterate over tweets, starting from the moment you run your application and continuing to older tweets, I recommend using max_id in your next query parameters setting it with the id field of the last result from your query as suggested here.
I have been integrating my application with QuickBooks using the SDK QBFC. I have invoices working successfully. The issue I have come across and am struggling to find recources for is with credits. When sending the request to create an invoice with a negative value I get this message:
"Transaction amount must be positive."
I have tried using using the quantity as a negative and rate hoping it would work out the amount as a negative but then I got this:
"You can't use negative rates on inventory items, use neg quantity instead"
So, I have come to the realization that I need to use the Refunds and Adjustments in QuickBooks and cannot find any examples to follow.
I have worked this out. Using the same structure you would to create the request for an invoice but replace:
Dim invAdd As IInvoiceAdd
Set invAdd = msgSetRq.AppendInvoiceAddRq
With:
Dim refundAdd As ICreditMemoAdd
Set refundAdd = msgSetRq.AppendCreditMemoAddRq
I understand SimpleDB doesn't have an auto increment but I am working on a script where I need to query the database by sending the id of the last record I've already pulled and pull all subsequent records. In a normal SQL fashion if there were 6200 records I already have 6100 of them when I run the script I query records with an ID greater than > 6100. Looking at the response object, I don't see anything I can use. It just seems like there should be a sequential index there. The other option I was thinking would be a real time stamp. Any ideas are much appreciated.
Using a timestamp was perfect for what I needed to do. I followed this article to help me on my way:http://aws.amazon.com/articles/1232 I would still welcome if anyone knows if there is a way to get an incremental index number.
I am trying to use the graph api with limit and since
I think the highest limit is 5000, so I am using that ( I want to make the fewest calls).
I am also trying to look 1 month back.
So I try:
https://graph.facebook.com/[ID of page]/feed&access_token=[accesstoken]&limit=5000&since=11-12-24
and I get 207 results, and the earliest date is december 24th, this is all fine, its saying hey there are only 207 results in the last month. The problem is there is a next link that has:
"next": "https://graph.facebook.com/[id of page]/feed?limit=5000&until=1324702511"
If I get this page, I start getting posts beore december 24th.
So my question is, how can I be sure I get all posts after a given date with fewest calls???
The kludge I am thinking of is to set the since on the first call to 1 day before, then if I get a post with that date, I know I got them all, if not I paginate... 5000 posts in one month is a lot, but I think its possible...
It seems like facebook should provide a way to get since with highest limit possible...I read this http://developers.facebook.com/blog/post/478/ but im still confused.
I am using Graph API for getting insights of the page. For that I am using link like :
https://graph.facebook.com/MYPAGEID/insights/page_fans?access_token=MYACCESSTOKEN
This link gives me last three days of json object which is ok, but I want to specify date range in insights. I found end_date in documentation but not found start date.
Did any one know how I specify date range in this.
You can use the since and until parameters. For example:
https://graph.facebook.com/MYPAGEID/insights/page_fans?since=2011-01-01&until=2011-05-05&access_token=MYACCESSTOKEN
The only limitation is that you the range you specify cannot include be longer than about 35 days, otherwise you'll get this exception:
OAuthException
(#604) The specified date range cannot exceed 3024000 seconds"
Also see FB's own description of this using these parameters here: http://developers.facebook.com/blog/post/478