Get Campaign IDs through Version V1

ads

#1

As per the V1 API document https://dev.twitter.com/ads/reference/1/get/stats/accounts/%3Aaccount_id it is mandatory to pass entity_ids in the request.

In version V0 I was referring this URL https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/campaigns to get the entity_ids/campaign_ids. I am not able to get this request through version V1.

Do I need to use V0 to get campaign_ids and V1 to get stats or is there any other document which I am missing?

Thanks
Deepak Garg


#2

Hi @DeepakGarg89! The v1 call to https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/campaigns should work, so let’s see why this is not working for you. Please post the raw http request you’re making, and the raw http response.


#3

You should be able to continue to call campaigns endpoint and you can confirm with a Twurl call like this:

twurl -H ads-api.twitter.com ‘/1/accounts/:account_id/campaigns?sort_by=updated_at-desc’

For many of the endpoints (all besides those called out specifically in migration guide) it’s simply a matter of changing the 0 to a 1.

The entity_id is simply a catch all and not a separate type of ID being returned (to call for Campaign stats simply pass the campaign_id as the entity_id)

Good luck with your migration!
John