Hi @controledash! What you want is to get the targeting options, which are set on the line item. So you must first get the line items and see which one has the campaign_id property equal to the campaign’s twitter id, and then you use the endpoint GET accounts/:account_id/targeting_criteria with the parameter line_item_id equal to the line item id found earlier, and you get all the targeting options, among which you can find the campaign interests, if it has any.
Below, it’s my PHP function that I use to get all line items, maybe you find it useful:
function getLineItems () {
global $tw, $twAccount;
$allLineItems = array();
$params = array('with_deleted' => true, 'sort_by' => 'created_at-asc');
$lineItems = $tw->get('accounts/' . $twAccount['id_tw_account'] . '/line_items', $params);
while (!empty($lineItems) && empty($lineItems->error) && !empty($lineItems->data)) {
$allLineItems = array_merge($allLineItems, $lineItems->data);
if (empty($lineItems->next_cursor)) {
break;
}
$lineItems = $tw->get('accounts/' . $twAccount['id_tw_account'] . '/line_items', array_merge($params, array('cursor' => $lineItems->next_cursor)));
}
return $allLineItems;
}