The parameters are the same. Create successfully with save() and fail with batch_save()
code:
line_item_1 = LineItem(account)
line_item_1.campaign_id = “fi83f”
line_item_1.name = ‘my first ad’
line_item_1.product_type = PRODUCT.PROMOTED_TWEETS
line_item_1.placements = [PLACEMENT.ALL_ON_TWITTER]
line_item_1.objective = “APP_INSTALLS”
line_item_1.ios_app_store_identifier = “333903271”
line_item_1.bid_amount_local_micro = 10000
line_item_1.entity_status = ENTITY_STATUS.PAUSED
line_item_1.save()
print(line_item_1.id, line_item_1.name)
line_item_2 = LineItem(account)
line_item_2.campaign_id = “fi83f”
line_item_2.name = ‘my second ad’
line_item_2.product_type = PRODUCT.PROMOTED_TWEETS
line_item_2.placements = [PLACEMENT.ALL_ON_TWITTER]
line_item_2.objective = “APP_INSTALLS”
line_item_2.ios_app_store_identifier = “333903271”
line_item_2.bid_amount_local_micro = 20000
line_item_2.entity_status = ENTITY_STATUS.PAUSED
line_items_list = [line_item_2]
LineItem.batch_save(account, line_items_list)
print(line_item_2.id, line_item_2.name)
print result:
jbftn my first ad
twitter_ads.error.BadRequest: <BadRequest object at 0x1e5aa9fc888 code=400 details=[{'code': 'INVALID', 'message': 'You need to choose an app to promote.', 'attribute': ''}]>
The app being promoted should exist in the App Manager for this Ads Account. Separately, please do not add Twitter 333903271 or apps that you do not have permission to promote to your ads account.
I followed up with the engineering team and determined that the ios_app_store_identifier and android_app_store_identifier are not yet supported in the batch endpoints. The team is working on a fix and can notify this thread when this is supported.