1. For the same activity_start_Date and activity_end_Date, I am getting different list of entity id for same account, when pulled via Python SDK vs REST API. Am i missing anything here?

#Python SDK
start=“2021-12-01 00:00:00”
start_time = datetime.strptime(start, ‘%Y-%m-%d %H:%M:%S’)
end = “2021-12-02 00:00:00”
end_time = datetime.strptime(end, ‘%Y-%m-%d %H:%M:%S’)
active_entities = LineItem.active_entities(account, start_time, end_time)
ids = [d[‘entity_id’] for d in active_entities]

#Using REST API
GET https://ads-api.twitter.com/10/stats/accounts/{ACCOUNT_ID}/active_entities?start_time=2021-12-01&end_time=2021-12-02&entity=CAMPAIGN

  1. Also when I use entity_id returned from python SDK to get campaign_name using below REST API, I get empty response.

GET https://ads-api.twitter.com/10/accounts/{ACCOUNT_ID})/campaigns?campaign_ids=knm3c

Any response on this please?
I get different Id’s returned between python SDK vs API.

#With python SDK
active_entities = LineItem.active_entities(account, start_time, end_time)

fetching stats for multiple line items

ids = [d[‘entity_id’] for d in active_entities]

#Using REST API
GET https://ads-api.twitter.com/10/stats/accounts/{ACCOUNT_ID}/active_entities?start_time=2021-12-01&end_time=2021-12-02&entity=CAMPAIGN

Both returned different list of Id’s.

Also, when i try to get campaign metadata using below API by passing Id returned from python SDK, it returned empty result.

GET https://ads-api.twitter.com/10/accounts/{ACCOUNT_ID})/campaigns?campaign_ids=knm3c

Seems like there is different entity_id concept for LineItem and campaign? How can i drive relation between them?
Like if i use entity_id for entity=campaign then async analytics call returns empty result.
Below call results empty result.

active_entities = LineItem.active_entities(account, start_time, end_time, entity=‘CAMPAIGN’)
campaignId_list = [d[‘entity_id’] for d in active_entities]

queued_job_ids = []
for chunk_ids in split_list(campaign_Ids, 20):
     queued_job_ids.append(LineItem.queue_async_stats_job(account, chunk_ids, metric_groups, granularity=granularity, placement=placement, start_time=start_time, end_time=end_time, country=country, segmentation_type=segmentation_type).id)

seconds = 120
time.sleep(seconds)
async_stats_job_results = LineItem.async_stats_job_result(account, job_ids=queued_job_ids)
async_data = []
try:
  for result in async_stats_job_results:
      async_data.append(LineItem.async_stats_job_data(account, url=result.url))
except:
    pass
print(async_data)