How can I pass an array to an api call from my plugin?
You're right, this won't work— PHP doesn't know how to flatten an array into a URL param.

But! Guzzle has it's own way of collating multiple values for one param.

Basically, you build your query with Guzzle's API, then repeatedly add values to the same param with the getPostFields()-&gt;add() method.

# Note that the second argument below may need to be populated with your custom headers— but Guzzle may also take care of this when using this method…
$req = new \Guzzle\Http\Client('https://www.site.com/api/')-&gt;post('users', [], [
  'param' =&gt; 'val' # …and any other single-use keys can be set early
]);


foreach ( $selectedActivities as $option ) {
  $req-&gt;getPostFields()-&gt;add('param-name', $option-&gt;value);
}


I can't tell you how to visualize the URL this eventually builds, but I think the key is sending data in the body, rather than trying to manually build a query string (which still ought to work, but there are odd behaviors when duplicate params exist).