Retrieving objective for a campaign via API


#1

Hello,

Just wanted to confirm one point. It seems that the /campaigns endpoint doesn’t mention the possibility of retrieving the objective of a campaign: https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/campaigns.

Is that the case?

It seems to be available by querying a line_item within this campaign (https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/line-items), but this requires one call per campaign, so not ideal of course.

Thanks!


#2

Thanks for the question, @MGruau. You are correct that the objective is set at the line item. If you want to avoid making a line_items request for every campaign, you can use the campaign_ids parameter on the GET accounts/:account_id/line_items endpoint. You can specify up to 200 campaign IDs in the request.


#3

Thanks a lot, I didn’t know that detail and that’s going to be extremely helpful.