Cannot get datalist items from query


I am new to Yeeflow and now try Yeeflow API using PHP with cURL. I have no problem getting fields of a datalist using{appID}/{listID}/fields
However, when I try to query datalist item using{appID}/{listID}/items/query
the result always return “appID or listid invalid”

Below is the code

		$site = "";
		$header = [
		$ch = curl_init($site);

		$data = array("PageIndex"=>1, 
		curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 				
		curl_setopt($ch, CURLOPT_POST,true);
		curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data) );
		$result = curl_exec($ch);
		$curl_result = curl_getinfo($ch, CURLINFO_HTTP_CODE );

		$error_msg = curl_error($ch);			

Thanks a lot for your help

Hi Andy,

The API service endpoint accepts JSON object. You may try below code to set request body.

$payload = json_encode( array( "PageIndex"=> 1, "PageSize"=>100 ) );
curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload );


Hi Frank,

It works now

Thanks a lot

Best regards,