CQL errors with PHP SDK and API
We're having problems trying to use Checkfront's example code (see https://github.com/Checkfront/PHP-SDK/blob/master/examples/db-query-cql.php) and the PHP SDK to access Checkfront using the API. As Checkfront support have just told us that they do not provide any ticket support for use of the API, we'd be very grateful if anyone could throw any light on the problem.
Checkfront's supplied example code executes the CQL statement $Checkfront->cql('select * from status') and we have this working as advertised. However, simply changing the CQL statement in the example code to execute any of the other CQL statements listed on the Checkfront CQL Query Reference Guide (see http://www.checkfront.com/developers/api-cql/) just generate errors. Here are a couple of examples:
Example 1: print_r($Checkfront->cql('SHOW TABLES')) ;
Result:
Result:
Error:
array (
'curl' => '',
)
We've tried a range of upper and lower case, including back quotes and so on without success. We're very likely missing something obvious - can anyone see what it is?! :-)
Thanks in advance
Peter
Checkfront's supplied example code executes the CQL statement $Checkfront->cql('select * from status') and we have this working as advertised. However, simply changing the CQL statement in the example code to execute any of the other CQL statements listed on the Checkfront CQL Query Reference Guide (see http://www.checkfront.com/developers/api-cql/) just generate errors. Here are a couple of examples:
Example 1: print_r($Checkfront->cql('SHOW TABLES')) ;
Result:
ArrayExample 2: print_r($Checkfront->cql('DESCRIBE TABLE booking')) ;
(
[version] => 2
[host_id] => oursite.checkfront.co.uk
[name] => Our Name
[request] => Array
(
[obj] => cql/
[status] => OK
)
[query] => Array
(
[status] => FAIL
[results] => 0
[pages] => 1
[error] => CQL syntax error.
)
)
Result:
Error:
array (
'curl' => '',
)
We've tried a range of upper and lower case, including back quotes and so on without success. We're very likely missing something obvious - can anyone see what it is?! :-)
Thanks in advance
Peter
This discussion has been closed.
Comments
CQL doesn't support all of the standard SQL commands (describe, explain etc). In fact it supports only a few of them. And there is currently no direct access to the booking table. You should use the /api/2/booking interface for you calls.
What is it you are trying to achieve?
Thanks for the explanation about CQL. All we're aiming to do is retrieve details for all bookings for a particular date range to generate some custom reports. I'd assumed from the docs that we should do this with a CQL query, if you were able to give an example of how we're supposed to do this, that would be great.
Many thanks,
Peter
in light of the revelations by Jason, would it not be wise to update/remove the page
http://www.checkfront.com/developers/api-cql/
Ive just wasted an hour of my life on this, its all well and good not supporting the API but publishing misleading/incorrect information is not helpful.
Do you think you could enlighten us with the calls you do actually support?