I was able to get the data when we use synchronous analytics endpoints
App name used : PMReporting
Twitter user account used :
Below are end points used to get the data.
But, we are not receiving any data same query with asynchronous analytics endpoints
Note: even I tried to increase the data range up to 90 days because due to no segmentation.
Sudheer Reddy J
Hi @Abhishek ,
Could you please provide us the
entity_ids value in the query parameter you masked? I need that to reproduce and investigate it.
Entity Id :3ijl92
I checked it but I’m seeing data correctly both on Sync and Async endpoint using the exact same request parameters you provided and hence couldn’t reproduce it. Just to confirm, with Async endpoint, you need to download
.gz file once your job is done (
I am able to get data now. When we download and extract the gz file it is in json fomrat. it it possible to download any other formats rather than Json like csv file.
Thanks and Regards
Could you please help with below queries
- When we download and extract the gz file, it is in json fomrat.is it possible to download any other formats rather than json like (csv, excel etc…) file?
- When we Passing Multiple Metric Groups for single request it is giving unauthorized exception.
- Multiple gz files are receiving for multiple dates, can we get single gz file for multiple dates ?
When we request data through GET we are able to receive the data by generating signature in header.
But with same signature generating procedure for POST request we are receiving Unauthorized exception.
Could you please help here
Sudheer J .
When we download and extract the gz file, it is in json fomrat.is it possible to download any other formats rather than json like (csv, excel etc…) file?No. You might want to subscribe to https://github.com/twitterdev/twitter-python-ads-sdk/issues/115 though.
When we request data through GET we are able to receive the data by generating signature in header. But with same signature generating procedure for POST request we are receiving Unauthorized exception.Since we use OAuth1.0a, a signature is unique per request and you can’t just copy it for other requests like that.
We are not copying the same signature, we are regenerating signature for POST request like GET Request.
oauthrequestString : POST&https%3A%2F%2Fads-api.twitter.com%2F5%2Fstats%2Fjobs%2Faccounts%2F1jwosn&end_time%3D2019-08-02%26entity%3DPROMOTED_TWEET%26entity_ids%3D3ijl92%26granularity%3DTOTAL%26metric_groups%3DENGAGEMENT%26oauth_consumer_key%3Dxxxx%26oauth_nonce%3DXXXX%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3DXXXX%26oauth_token%3Dxxxx%26oauth_version%3D1.0%26placement%3DALL_ON_TWITTER%26start_time%3D2019-05-04
KeyString : oauth_consumer_secret & oauth_token_secret
Signature : computed Hash value by providing oauthrequestString and KeyString
Below is the header we generated for post request
still we are facing the issue.
any special permissions required for POST request ?
@Abhishek It looks like you’re using Postman as well, right? Are you getting 401 error with your own custom HTTP client? What’s your App ID?
Are you using some kind of OAuth library? or generating signature manually? We highly recommend not generating it manually as there’s a lot of pitfalls.
We are using HttpWebRequest class to make calls to twitter ads api, We generally will test in post man and once request is ok we will generating request calls based on Postman process.
APP ID : 16485156
Any specific Oauth libary would you suggest ?
We used GetAuthorizationHeader(parameters) method from OAuth library to genreate header for post request, but still it has the same issue.
@Abhishek Not sure how much I can help you with as I can’t see your actual code. All I can do here is to give you some possible causes of failure.
Just to confirm, you’re able to make a successful request using Postman, but your own code, correct?
Are you encoding your request URL as well? (e.g.,
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.