Skip to content

Search in Grid/Matrix cells

The Webservice module has also support for searching in Grid or Matrix cells.

Example Rest

http://domain.com/webservice/rest/search_entry?auth[shortkey]=27dd39e*7d&data[grid][cell_1]=test

As you can see, you only have to use a multi dimensional array to do this.

Example Curl

<?php
$url = 'http://domain.com/index.php/webservice/rest/search_entry';

//set POST variables
$fields = array(
    'auth' => array(
        'username' => 'admin',
        'password' => 'test123',
    ),
    'data' => array(
        'grid' => array(
            'cell_1' => 'test'
        )
    )
);

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, urldecode(http_build_query($fields)));

//execute post
$result = curl_exec($ch);

//close connection
curl_close($ch);

?>