API PHP - Syntax for route print

Hi can anyone assist me with the corerct syntax for the terminal command:

/ip route print where active dynamic connect

currently I have the following code:

$API->write('/ip/route/print', false);
$API->write('?active', false);
$API->write('/dynamic', false);
$API->write('/connect');
  1. Is it correct ?
  2. Is “pref-src” the correct array name for that field?

Many thanks for a ny assistance.

not quite, please look up this:
http://wiki.mikrotik.com/wiki/API#Queries

or for the impatient:

/ip/route/print
?connect
?dynamic
?active=true

note that order of query lines is important, and as first filter add one that filters out most of entries, then go to more specific ones.

Many thanks works perfect