Yes, this does make sense. The problem Im having is executing the call, as there isnt much example code on advanced php queries like this. This is what I got so far:
$feature_names = array('update_expires');$feature_values = array(date('Y-m-d', strtotime('-30 days')));$feature_match = array('before');
$post_data = array('method' => 'limelm.pkey.advancedSearch','version_id' => $version_id,'api_key' => $api_key,'nojsoncallback' => 1,'format' => 'json','num' => 20);
if ($feature_names !== null){$post_data['feature_name'] = $feature_names;$post_data['feature_value'] = $feature_values;$post_data['feature_match'] = $feature_match;}
// urlencode $post_data$post_string = '';foreach ($post_data as $key => $value){if (is_array($value)){foreach ($value as $sub_value){$post_string .= $key.'[]='.urlencode($sub_value).'&';}}else$post_string .= $key.'='.urlencode($value).'&';}$post_string = rtrim($post_string, '& ');
$request = curl_init('https://wyday.com/limelm/api/rest/');curl_setopt($request, CURLOPT_HEADER, 0);curl_setopt($request, CURLOPT_ENCODING, "");curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);curl_setopt($request, CURLOPT_POSTFIELDS, $post_string);curl_setopt($request, CURLOPT_SSL_VERIFYPEER, TRUE);
In this example, I would like API to return all keys where the custom license field update_expires is more that 30 days old. However, there seems to be some error in the code, as the API doesnt return any keys. Suggestions?
Thanks