How to pass multiple participants when add an activity?

I’m using php to call add activity with multiple participants, according to the doc, [{“person_id”:6,“primary_flag”:true}] is the format should be supplied, but there is always an error said Expected argument of type “array or Traversable”, “string” given in , after json_encode(array(‘person_id’=>1, ‘primary_flag’:true)), any ideas?
(upload://kpTx3ANhan1v9jLlq0YSEBFh1AF.png)

Hey 181,

It’s a good thing you pointed this out as it isn’t clear in the Docs.
Essentially, only 1 Participant can have a "primary_flag":true (it can be whichever contact you want) and for any additional Participants, they need to have "primary_flag":false

Thanks David. I figured out it works that way too. For others who may use this later, we need to pass multi participants as array of arrays in php, as David said, For the deal related person, it would be array(‘person_id’=>1, ‘primary_flag’=>true), all the other persons have to be primary_flag as false.
e.g. array(‘person_id’=>3, ‘primary_flag’=>false). so the final would be :
[[‘person_id’=>1, ‘primary_flag’=>true],[‘person_id’=>3, ‘primary_flag’=>flase]]