Can any one tell me the correct way of getting the ids of account which are sharing one Custom Audience i.e. adaccounts
Query in PHP using API v2.4
$account = new AdAccount($accountId);
$fields = array(
CustomAudienceFields::ID,
CustomAudienceFields::NAME,
CustomAudienceFields::SUBTYPE,
CustomAudienceFields::ACCOUNT_ID,
CustomAudienceFields::ADACCOUNTS,
);
$params = array('filters'=>array(
array(
'field'=>'subtype',
'type'=>'in',
'value'=>['WEBSITE','CUSTOM'],
),
),);
$CustomAudience = $account->getCustomAudiences($fields,$params);
Results
[adaccounts] => Array ( [data] => Array ( [0] => 9.1432423423488E+14 [1] => 8.9623423402405E+14 [2] => 8.71252342345443E+14 [3] => 8.832242342342387E+14 [4] => 8.92234234079338E+14 ) )
Note: I added this property myself in CustomAudienceFileds.php:
"CustomAudienceFields::ADACCOUNTS"
PROBLEM
All values are in float or I don't know what these values are actually.
I converted these values to int but they appeared to be in negative and wrong account ids.
Please let me know what what and where I am wrong.
Its working absolutely fine in Graph Api Explorer tool when I Query this:
Query in Graph Api Explorer v2.4:
act_34234234234344/customaudiences?fields=adaccounts
Results:
"adaccounts": {
"data": [
534534534534555,
564563453454534,
345345345345345,
234234234234234
]
}