First I sent the http request to get all the list of campaigns to the below endpoint and request went through successfully both in powershell script and as well as in Postman
https://ads-api.twitter.com/4/accounts/18ce53zx1fm/campaigns
that means my logic to create the oauth signature, timestamp, nonce and other credentials provided in the script worked for getting the campaigns list
For the campaign list I used Base URL as “https://ads-api.twitter.com/4/accounts/18ce53zx1fm/campaigns” which worked fine.
Then I tried to get the Ad performance report and below is the endpoint
https://ads-api.twitter.com/4/stats/accounts/accountId?granularity=DAY&placement=ALL_ON_TWITTER&start_time=2018-11-26&end_time=2018-11-28&entity=CAMPAIGN&entity_ids=(list of campaignIds separated by “,”)&metric_groups=ENGAGEMENT,WEB_CONVERSION
But the problem is that I’m getting UNAUTHORIZED error when I tried to do it through powershell script
whereas request is successfull when I used Postman
{“errors”:[{“code”:“UNAUTHORIZED_ACCESS”,“message”:“This request is not properly authenticated”}],“request”:{“params”:{}}}
Base URL for this one is “https://ads-api.twitter.com/4/stats/accounts/18ce53zx1fm”
is that the correct base URL for the ad performance report?