How to get the numerical ID for ads campaign instead of the alphabet one?

ads

#1

Twurl Call:

twurl -H "https://ads-api.twitter.com" "/4/accounts/18ce54n9c8t/campaigns/afv1l"

{"request":{"params":{"campaign_id":"afv1l","account_id":"18ce54n9c8t"}},"data":{"name":"BTS-22671","start_time":"2018-02-26T08:01:00Z","reasons_not_servable":["PAUSED_BY_ADVERTISER"],"servable":false,"daily_budget_amount_local_micro":10000000,"end_time":null,"funding_instrument_id":"qphyr","duration_in_days":null,"standard_delivery":true,"total_budget_amount_local_micro":null,"id":"afv1l","entity_status":"PAUSED","account_id":"18ce54n9c8t","frequency_cap":null,"currency":"USD","created_at":"2018-02-26T08:01:54Z","updated_at":"2018-02-27T03:13:41Z","deleted":false}}

But when I visit that campaign in ads.twitter.com, I got that the url:

https://ads.twitter.com/ads_manager/18ce54n9c8t/fundingsources/44859699/campaigns/17536233/adgroups/?endDate=2018-12-04&startDate=2018-11-28

I noticed /campaigns/17536233, it seems every campaign have a numerical ID which used by ads.twitter.com. But what I got from API is just alphabet one(17536233 vs afv1l).

Is there any way to get the numerical ID of a campaign from the API?


Ads-api analytics question
#2

Hi @kisnu this is sort of a FAQ and some partners store or display the ID as both forms depending on the situation, but the difference is that the one with mix of letters and numbers is in base-36 and the numerical ID is base-10 (they are always referring to the same number)

There are ways to do it based upon languages but here’s a simple example from Python:

num = “1gr”
int(num, 36)
1899